[FIX] barcodes,point_of_sale,stock,base: minor changes from code review
[odoo/odoo.git] / addons / stock / test / procrule.yml
1
2   Create new global procurement rule from Stock -> Output
3
4   !record {model: procurement.rule, id: global_proc_rule}:
5     name: Stock -> output
6     action: move
7     picking_type_id: stock.picking_type_internal
8     location_src_id: stock.stock_location_stock
9     location_id: stock.stock_location_output 
10
11   Create Delivery Order from Output -> Customer 
12
13   !record {model: stock.picking, id: pick_output}:
14     name: Delivery order for procurement
15     partner_id: base.res_partner_2
16     picking_type_id: stock.picking_type_out
17     move_lines:
18         - product_id: product.product_product_3
19           product_uom_qty: 10.00
20           location_id: stock.stock_location_output
21           location_dest_id: stock.stock_location_customers
22           procure_method: make_to_order
23
24   Confirm delivery order.
25
26   !python {model: stock.picking}: |
27     self.action_confirm(cr, uid,  [ref('pick_output')])
28 -
29   I run the scheduler.
30 -
31   !python {model: procurement.order}: |
32     self.run_scheduler(cr, uid)
33
34   Check a picking was created from stock to output.
35
36   !python {model: stock.move }: |
37     picking = self.pool.get("stock.picking").browse(cr, uid, ref("pick_output"))
38     move_id = self.search(cr, uid, [('product_id', '=', ref('product.product_product_3')),('location_id', '=', ref('stock.stock_location_stock')),
39     ('location_dest_id', '=', ref('stock.stock_location_output')), ('move_dest_id', '=', picking.move_lines[0].id)])
40     assert len(move_id) == 1, "It should have created a picking from Stock to Output with the original picking as destination"