File: repair_data.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (24 lines) | stat: -rw-r--r-- 1,420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
    <!--
    Given that data are loaded before update of warehouses through the post_init_hook,
    we manually create the 'Repairs' Operation Type in warehouse0 here such that it's available
    when the initialization of data triggers the default method of the required field 'picking_type_id'.
    -->

    <record id="picking_type_warehouse0_repair" model="stock.picking.type" forcecreate="0">
        <field name="name">Repairs</field>
        <field name="code">repair_operation</field>
        <field name="company_id" ref="base.main_company"/>
        <field name="default_location_src_id" ref="stock.stock_location_stock"/>
        <field name="default_location_dest_id" model="stock.location" search="[('usage', '=', 'production'), ('company_id', '=', obj().env.ref('base.main_company').id)]"/>
        <field name="default_remove_location_dest_id" model="stock.location" search="[('scrap_location', '=', True), ('company_id', '=', obj().env.ref('base.main_company').id)]"/>
        <field name="default_recycle_location_dest_id" ref="stock.stock_location_stock"/>
        <field name="sequence_code">RO</field>
        <field name="warehouse_id" ref="stock.warehouse0"/>
    </record>

    <record id='stock.warehouse0' model='stock.warehouse'>
        <field name='repair_type_id' ref='repair.picking_type_warehouse0_repair'/>
    </record>
</odoo>