[FIX] stock: typo incomming -> incoming in demo & tests
[odoo/odoo.git] / addons / stock / stock_demo.yml
1 -
2   !python {model: ir.model.data}: |
3     chicago_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context)
4
5     #create xml ids for demo data that are widely used in tests or in other codes, for more convenience
6     xml_references = [
7         {'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.in_type_id.id},
8         {'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.out_type_id.id},
9         {'name':'stock_location_shop0','module':'stock', 'model':'stock.location','res_id': chicago_warehouse.lot_stock_id.id},
10     ]
11     for xml_record in xml_references:
12         xml_ids = self.search(cr, uid, [('module', '=', xml_record['module']), ('model', '=', xml_record['model']), ('name', '=', xml_record['name'])], context=context)
13         if not xml_ids:
14             self.create(cr, uid, xml_record, context=context)
15         #avoid the xml id and the associated resource being dropped by the orm by manually making a hit on it
16         self._update_dummy(cr, uid, xml_record['model'], xml_record['module'], xml_record['name'])
17 -
18  !record {model: stock.location, id: location_refrigerator_small}:
19     name: Small Refrigerator
20     usage: internal
21     location_id: stock_location_14
22 -
23  !record {model: product.product, id: product_icecream}:
24     default_code: 001
25     name: Ice Cream
26     type: product
27     categ_id: product.product_category_1
28     list_price: 100.0
29     standard_price: 70.0
30     uom_id: product.product_uom_kgm
31     uom_po_id: product.product_uom_kgm
32     property_stock_inventory: location_inventory
33     description: Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events.
34 -
35  !record {model: stock.production.lot, id: lot_icecream_0}:
36     name: Lot0 for Ice cream
37     product_id: product_icecream
38 -
39  !record {model: stock.production.lot, id: lot_icecream_1}:
40     name: Lot1 for Ice cream
41     product_id: product_icecream
42 -
43  !record {model: stock.inventory, id: stock_inventory_icecream}:
44     name: Inventory for icecream
45     filter: 'product'
46     product_id: product_icecream
47 -
48  !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot0}:
49     product_id: product_icecream
50     product_uom_id: product.product_uom_kgm
51     inventory_id: stock_inventory_icecream
52     product_qty: 50.0
53     prod_lot_id: lot_icecream_0
54     location_id: stock_location_14
55 -
56  !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}:
57     product_id: product_icecream
58     product_uom_id: product.product_uom_kgm
59     inventory_id: stock_inventory_icecream
60     product_qty: 40.0
61     prod_lot_id: lot_icecream_1
62     location_id: stock_location_14
63 -
64     Create STOCK_MOVE for OUT
65 -
66  !record {model: stock.picking, id: outgoing_shipment_main_warehouse}:
67     picking_type_id: stock.picking_type_out
68     origin: 'outgoing shipment main_warehouse'
69     partner_id: base.res_partner_6
70     move_lines:
71       - product_id: product.product_product_27
72         product_uom: product.product_uom_unit
73         product_uom_qty: 15.0
74         picking_type_id: stock.picking_type_out
75         location_id: stock.stock_location_stock
76         location_dest_id: stock.stock_location_customers
77 -
78  !record {model: stock.picking, id: outgoing_shipment_main_warehouse1}:
79     picking_type_id: stock.picking_type_out
80     origin: 'outgoing shipment'
81     partner_id: base.res_partner_6
82     date: !eval "'%s-%s-15' %((datetime.now()-timedelta(days=60)).year, (datetime.now()-timedelta(days=60)).month)"
83     move_lines:
84       - product_id: product.product_product_6
85         product_uom: product.product_uom_unit
86         product_uom_qty: 180.0
87         picking_type_id: stock.picking_type_out
88         location_id: stock.stock_location_stock
89         location_dest_id: stock.stock_location_customers
90     pack_operation_ids:
91       - product_id: product.product_product_6
92         product_qty: 100
93         product_uom_id: product.product_uom_unit
94         location_id: stock.stock_location_stock
95         location_dest_id: stock.stock_location_customers
96 -
97  !record {model: stock.picking, id: outgoing_shipment_main_warehouse2}:
98     picking_type_id: stock.picking_type_out
99     origin: 'outgoing shipment your_company warehouse'
100     partner_id: base.res_partner_6
101     date: !eval "'%s-%s-15' % ((datetime.now()-timedelta(days=30)).month,(datetime.now()-timedelta(days=30)).month)"
102     move_lines:
103       - product_id: product.product_product_31
104         product_uom: product.product_uom_unit
105         product_uom_qty: 45.0
106         picking_type_id: stock.picking_type_out
107         location_id: stock.stock_location_stock
108         location_dest_id: stock.stock_location_customers
109 -
110  !record {model: stock.picking, id: outgoing_shipment_main_warehouse3}:
111     picking_type_id: stock.picking_type_out
112     origin: 'your company warehouse'
113     partner_id: base.res_partner_6
114     move_lines:
115       - product_id: product.product_product_5
116         product_uom: product.product_uom_unit
117         product_uom_qty: 75.0
118         picking_type_id: stock.picking_type_out
119         location_id: stock.stock_location_stock
120         location_dest_id: stock.stock_location_customers
121 -
122     Create STOCK_PICKING for IN
123 -
124  !record {model: stock.picking, id: incomming_shipment}:
125     picking_type_id: stock.picking_type_in
126     origin: 'incoming_shipment for test'
127 -
128  !record {model: stock.move, id: incomming_shipment_icecream}:
129     picking_id: stock.incomming_shipment
130     product_id: product_icecream
131     product_uom: product.product_uom_kgm
132     product_uom_qty: 50.0
133     picking_type_id: stock.picking_type_in
134     location_id: stock_location_suppliers
135     location_dest_id: stock_location_14
136 -
137  !record {model: stock.picking, id: incomming_shipment1}:
138     picking_type_id: stock.picking_type_in
139     origin: 'incoming_shipment'
140     partner_id: base.res_partner_6
141     move_lines:
142       - product_id: product.product_product_48
143         product_uom: product.product_uom_unit
144         product_uom_qty: 35.0
145         picking_type_id: stock.picking_type_in
146         location_id: stock.stock_location_suppliers
147         location_dest_id: stock.stock_location_stock
148 -
149  !record {model: stock.picking, id: incomming_shipment2}:
150     picking_type_id: stock.picking_type_in
151     origin: 'incoming_shipment main_warehouse'
152     partner_id: base.res_partner_6
153     move_lines:
154       - product_id: product.product_product_22
155         product_uom: product.product_uom_unit
156         product_uom_qty: 125.0
157         picking_type_id: stock.picking_type_in
158         location_id: stock.stock_location_suppliers
159         location_dest_id: stock.stock_location_stock
160 -
161  !record {model: stock.picking, id: incomming_shipment3}:
162     picking_type_id: stock.picking_type_in
163     origin: 'incoming_shipment your_company warehouse'
164     partner_id: base.res_partner_6
165     move_lines:
166       - product_id: product.product_product_10
167         product_uom: product.product_uom_unit
168         product_uom_qty: 120.0
169         picking_type_id: stock.picking_type_in
170         location_id: stock.stock_location_suppliers
171         location_dest_id: stock.stock_location_stock
172 -
173  !record {model: stock.picking, id: incomming_shipment4}:
174     picking_type_id: stock.picking_type_in
175     origin: 'incoming_shipment_main_warehouse'
176     partner_id: base.res_partner_6
177     move_lines:
178       - product_id: product.product_product_31
179         product_uom: product.product_uom_unit
180         product_uom_qty: 50.0
181         picking_type_id: stock.picking_type_in
182         location_id: stock.stock_location_suppliers
183         location_dest_id: stock.stock_location_stock
184 -
185    Create STOCK_PICKING_IN for Chicago Warehouse
186 -
187  !record {model: stock.picking, id: incomming_chicago_warehouse}:
188     picking_type_id: chi_picking_type_in
189     origin: 'incoming_chicago_warehouse'
190     partner_id: base.res_partner_6
191     move_lines:
192       - product_id: product.product_product_9
193         product_uom: product.product_uom_unit
194         product_uom_qty: 25.0
195         picking_type_id: chi_picking_type_in
196         location_id: stock.stock_location_suppliers
197         location_dest_id: stock.stock_location_shop0
198 -
199  !record {model: stock.picking, id: incomming_chicago_warehouse1}:
200     picking_type_id: chi_picking_type_in
201     origin: 'incoming_shipment_chicago_warehouse'
202     partner_id: base.res_partner_6
203     move_lines:
204       - product_id: product.product_product_48
205         product_uom: product.product_uom_unit
206         product_uom_qty: 180.0
207         picking_type_id: chi_picking_type_in
208         location_id: stock.stock_location_suppliers
209         location_dest_id: stock.stock_location_shop0
210         state: done
211     pack_operation_ids:
212       - product_id: product.product_product_48
213         product_qty: 100
214         product_uom_id: product.product_uom_unit
215         location_id: stock.stock_location_suppliers
216         location_dest_id: stock.stock_location_shop0
217 -
218  !record {model: stock.picking, id: incomming_chicago_warehouse2}:
219     picking_type_id: chi_picking_type_in
220     origin: 'incoming_shipment chicago_warehouse'
221     partner_id: base.res_partner_6
222     move_lines:
223       - product_id: product.product_product_32
224         product_uom: product.product_uom_unit
225         product_uom_qty: 45.0
226         picking_type_id: chi_picking_type_in
227         location_id: stock.stock_location_suppliers
228         location_dest_id: stock.stock_location_shop0
229 -
230  !record {model: stock.picking, id: incomming_chicago_warehouse3}:
231     picking_type_id: chi_picking_type_in
232     origin: 'chicago_warehouse'
233     partner_id: base.res_partner_6
234     date: !eval "'%s-%s-2' % ((datetime.now()-timedelta(days=30)).month,(datetime.now()-timedelta(days=30)).month)"
235     move_lines:
236       - product_id: product.product_product_22
237         product_uom: product.product_uom_unit
238         product_uom_qty: 75.0
239         picking_type_id: chi_picking_type_in
240         location_id: stock.stock_location_suppliers
241         location_dest_id: stock.stock_location_shop0
242 -
243    Create STOCK_PICKING_OUT for Chicago Warehouse
244 -
245  !record {model: stock.picking, id: outgoing_chicago_warehouse}:
246     picking_type_id: chi_picking_type_out
247     origin: 'outgoing_chicago_warehouse'
248     partner_id: base.res_partner_6
249     move_lines:
250       - product_id: product.product_product_27
251         product_uom: product.product_uom_unit
252         product_uom_qty: 15.0
253         picking_type_id: chi_picking_type_out
254         location_id: stock.stock_location_shop0
255         location_dest_id: stock.stock_location_customers
256 -
257  !record {model: stock.picking, id: outgoing_chicago_warehouse1}:
258     picking_type_id: chi_picking_type_out
259     origin: 'outgoing_shipment_chicago_warehouse'
260     partner_id: base.res_partner_6
261     move_lines:
262       - product_id: product.product_product_6
263         product_uom: product.product_uom_unit
264         product_uom_qty: 180.0
265         picking_type_id: chi_picking_type_out
266         location_id: stock.stock_location_shop0
267         location_dest_id: stock.stock_location_customers
268     pack_operation_ids:
269       - product_id: product.product_product_6
270         product_qty: 100
271         product_uom_id: product.product_uom_unit
272         location_id: stock.stock_location_shop0
273         location_dest_id: stock.stock_location_customers
274 -
275  !record {model: stock.picking, id: outgoing_chicago_warehouse2}:
276     picking_type_id: chi_picking_type_out
277     origin: 'chicago_warehouse'
278     partner_id: base.res_partner_6
279     move_lines:
280       - product_id: product.product_product_31
281         product_uom: product.product_uom_unit
282         product_uom_qty: 45.0
283         picking_type_id: chi_picking_type_out
284         location_id: stock.stock_location_shop0
285         location_dest_id: stock.stock_location_customers
286 -
287  !record {model: stock.picking, id: outgoing_chicago_warehouse3}:
288     picking_type_id: chi_picking_type_out
289     origin: 'outgoing chicago warehouse'
290     partner_id: base.res_partner_6
291     move_lines:
292       - product_id: product.product_product_5
293         product_uom: product.product_uom_unit
294         product_uom_qty: 75.0
295         picking_type_id: chi_picking_type_out
296         location_id: stock.stock_location_shop0
297         location_dest_id: stock.stock_location_customers
298 -
299  !python {model: stock.picking}: |
300     self.action_confirm(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_shipment_main_warehouse1'),ref('incomming_shipment2'),ref('incomming_shipment1'),ref('incomming_shipment3'),ref('outgoing_chicago_warehouse3'),ref('outgoing_chicago_warehouse2'),ref('outgoing_chicago_warehouse1'),ref('incomming_chicago_warehouse1'),ref('incomming_chicago_warehouse2'),ref('incomming_chicago_warehouse3')], context=context)
301     record = self.browse(cr, uid, ref('outgoing_shipment_main_warehouse1'), context=context)
302     record_chi_in = self.browse(cr, uid, ref('incomming_chicago_warehouse1'), context=context)
303     record_chi_out = self.browse(cr, uid, ref('outgoing_chicago_warehouse1'), context=context)
304     if record.state != 'done' and record_chi_in.state != 'done' and record_chi_out.state != 'done':
305       self.force_assign(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_chicago_warehouse3'),ref('outgoing_shipment_main_warehouse2')], context=context)
306       self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context)