summaryrefslogtreecommitdiff
path: root/addons/stock_picking_batch/data/stock_picking_batch_demo.xml
blob: b8c0cc7f755b3a1058c3ab6c4205e983ac0ca1c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="utf-8"?>
<odoo><data noupdate="1">
    <!-- Add batch picking -->
    <record id="stock_picking_batch_1" model="stock.picking.batch">
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="company_id" ref="base.main_company"/>
    </record>
    <record id="stock_picking_batch_2" model="stock.picking.batch">
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="company_id" ref="base.main_company"/>
    </record>

    <!-- Resource: stock.inventory -->
    <record id="stock_inventory_1" model="stock.inventory">
        <field name="name">Starting Inventory</field>
    </record>

    <!-- Resource: stock.inventory.line -->
    <record id="stock_inventory_line_0" model="stock.inventory.line">
        <field name="product_id" ref="product.consu_delivery_01"/>
        <field name="product_uom_id" ref="uom.product_uom_unit"/>
        <field name="inventory_id" ref="stock_picking_batch.stock_inventory_1"/>
        <field name="product_qty">10.0</field>
        <field name="location_id" ref="stock.stock_location_stock"/>
    </record>

    <record id="stock_inventory_line_1" model="stock.inventory.line">
        <field name="product_id" ref="product.consu_delivery_02"/>
        <field name="product_uom_id" ref="uom.product_uom_unit"/>
        <field name="inventory_id" ref="stock_picking_batch.stock_inventory_1"/>
        <field name="product_qty">10.0</field>
        <field name="location_id" ref="stock.stock_location_stock"/>
    </record>

    <record id="stock_inventory_line_3" model="stock.inventory.line">
        <field name="product_id" ref="product.consu_delivery_03"/>
        <field name="product_uom_id" ref="uom.product_uom_unit"/>
        <field name="inventory_id" ref="stock_picking_batch.stock_inventory_1"/>
        <field name="product_qty">20.0</field>
        <field name="location_id" ref="stock.stock_location_stock"/>
    </record>

    <!-- Inventory start -->
    <function model="stock.inventory" name="_action_start">
        <function eval="[[('state','=','draft'),('id', '=', ref('stock_inventory_1'))]]" model="stock.inventory" name="search"/>
    </function>
    <!-- Inventory validate -->
    <function model="stock.inventory" name="action_validate">
        <function eval="[[('state','=','confirm'),('id', '=', ref('stock_inventory_1'))]]" model="stock.inventory" name="search"/>
    </function>

    <!-- Add picking -->
    <record id="Picking_A" model="stock.picking">
        <field name="move_type">one</field>
        <field name="priority">1</field>
        <field name="user_id" eval="False"/>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="batch_id" ref="stock_picking_batch_2"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="company_id" ref="base.main_company"/>
    </record>
    <record id="Picking_B" model="stock.picking">
        <field name="move_type">one</field>
        <field name="priority">0</field>
        <field name="user_id" eval="False"/>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="batch_id" ref="stock_picking_batch_2"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="company_id" ref="base.main_company"/>
    </record>
    <record id="Picking_C" model="stock.picking">
        <field name="move_type">one</field>
        <field name="priority">0</field>
        <field name="user_id" eval="False"/>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="batch_id" ref="stock_picking_batch_1"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="company_id" ref="base.main_company"/>
    </record>
    <record id="Picking_D" model="stock.picking">
        <field name="move_type">one</field>
        <field name="priority">1</field>
        <field name="user_id" eval="False"/>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="batch_id" ref="stock_picking_batch_1"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="company_id" ref="base.main_company"/>
    </record>

    <!-- Add stock move -->
    <record id="stock_move1" model="stock.move">
        <field name="name">A first stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_A"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">10</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.consu_delivery_01"/>
    </record>
    <record id="stock_move2" model="stock.move">
        <field name="name">A second stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_A"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">10</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.consu_delivery_02"/>
    </record>
    <record id="stock_move3" model="stock.move">
        <field name="name">A third stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_B"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">10</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.consu_delivery_03"/>
    </record>
    <record id="stock_move4" model="stock.move">
        <field name="name">A fourth stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_C"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">4</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.consu_delivery_03"/>
    </record>
    <record id="stock_move5" model="stock.move">
        <field name="name">A fifth stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_D"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">2</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.product_product_10"/>
    </record>
    <record id="stock_move6" model="stock.move">
        <field name="name">A sixth stock move</field>
        <field name="picking_type_id" ref="stock.picking_type_out"/>
        <field name="picking_id" ref="Picking_D"/>
        <field name="location_id" ref="stock.stock_location_stock"/>
        <field name="location_dest_id" ref="stock.stock_location_customers"/>
        <field name="product_uom_qty">3</field>
        <field name="product_uom" ref="uom.product_uom_unit" />
        <field name="product_id" ref="product.product_product_25"/>
    </record>

    <!-- Confirm Batch Pickings -->
    <function model="stock.picking.batch" name="action_confirm">
        <value eval="ref('stock_picking_batch_1')"/>
    </function>
    <function model="stock.picking.batch" name="action_confirm">
        <value eval="ref('stock_picking_batch_2')"/>
    </function>
    <!-- Check Availability -->
    <function model="stock.picking.batch" name="action_assign">
        <value eval="ref('stock_picking_batch_1')"/>
    </function>
    <function model="stock.picking.batch" name="action_assign">
        <value eval="ref('stock_picking_batch_2')"/>
    </function>
</data></odoo>