[IMP]Added referenced to published partners.
[odoo/odoo.git] / addons / stock_no_autopicking / test / stock_no_autopicking.yml
1 -
2   In order to test the module with OpenERP, I will make products with No auto-picking
3   to allow an intermediate picking process to provide raw materials to production orders.
4 -
5   I create a record for product Tea.
6 -
7   !record {model: product.product, id: product_product_tea0}:
8     categ_id: product.product_category_1
9     name: Tea
10     procure_method: make_to_stock
11     supply_method: buy
12     type: product
13     uom_id: product.product_uom_kgm
14     uom_po_id: product.product_uom_kgm
15     property_stock_inventory: stock.location_inventory
16     property_stock_procurement: stock.location_procurement
17     property_stock_production: stock.location_production
18     auto_pick: True
19 -
20   I create a record for product Sugar.
21 -
22   !record {model: product.product, id: product_product_sugar0}:
23     categ_id: product.product_category_1
24     name: Sugar
25     procure_method: make_to_stock
26     supply_method: buy
27     type: product
28     uom_id: product.product_uom_kgm
29     uom_po_id: product.product_uom_kgm
30     property_stock_inventory: stock.location_inventory
31     property_stock_procurement: stock.location_procurement
32     property_stock_production: stock.location_production
33     auto_pick: True
34 -
35   I create a record for product Milk.
36 -
37   !record {model: product.product, id: product_product_milk0}:
38     categ_id: product.product_category_1
39     name: Milk
40     procure_method: make_to_order
41     supply_method: buy
42     type: consu
43     uom_id: product.product_uom_litre
44     uom_po_id: product.product_uom_litre
45     property_stock_inventory: stock.location_inventory
46     property_stock_procurement: stock.location_procurement
47     property_stock_production: stock.location_production
48     auto_pick: True
49 -
50   I create a record for product Cup of tea.
51 -
52   !record {model: product.product, id: product_product_cupoftea0}:
53     categ_id: product.product_category_1
54     name: Cup of Tea
55     procure_method: make_to_order
56     supply_method: produce
57     type: product
58     uom_id: product.product_uom_litre
59     uom_po_id: product.product_uom_litre
60     property_stock_inventory: stock.location_inventory
61     property_stock_procurement: stock.location_procurement
62     property_stock_production: stock.location_production
63     auto_pick: False
64 -
65   I create a record for Workcenter.
66 -
67   !record {model: mrp.workcenter, id: mrp_workcenter_production0}:
68     costs_cycle: 0.0
69     costs_hour: 0.0
70     name: Production Workcenter
71     resource_type: material
72     time_cycle: 0.0
73     time_efficiency: 1.0
74     time_start: 0.0
75     time_stop: 0.0
76 -
77   I create a routing.
78 -
79   !record {model: mrp.routing, id: mrp_routing_productionrouting0}:
80     name: Production Routing
81     location_id: stock.stock_location_stock
82     workcenter_lines:
83       - cycle_nbr: 1.0
84         hour_nbr: 0.5
85         sequence: 0.0
86         name: Production
87         workcenter_id: mrp_workcenter_production0
88 -
89   I create a Bill of material for the product Cup of tea.
90 -
91   !record {model: mrp.bom, id: mrp_bom_cupoftea0}:
92     company_id: base.main_company
93     name: Cup of Tea
94     product_efficiency: 1.0
95     product_id: product_product_cupoftea0
96     product_qty: 1.0
97     product_uom: product.product_uom_litre
98     type: normal
99     routing_id: mrp_routing_productionrouting0
100     bom_lines:
101       - company_id: base.main_company
102         name: Tea
103         product_efficiency: 1.0
104         product_id: product_product_tea0
105         product_qty: 200.0
106         product_uom: product.product_uom_gram
107         type: normal
108       - company_id: base.main_company
109         name: Sugar
110         product_efficiency: 1.0
111         product_id: product_product_sugar0
112         product_qty: 200.0
113         product_uom: product.product_uom_gram
114         type: normal
115       - company_id: base.main_company
116         name: Water
117         product_efficiency: 1.0
118         product_id: product_product_milk0
119         product_qty: 0.5
120         product_uom: product.product_uom_litre
121         type: normal
122 -
123   I make the production order for the product Cup of Tea.
124 -
125   !record {model: mrp.production, id: mrp_production_mo0}:
126     product_id: product_product_cupoftea0
127     product_qty: 5.0
128     product_uom: product.product_uom_litre
129     product_uos_qty: 0.0
130     bom_id: mrp_bom_cupoftea0
131     routing_id: mrp_routing_productionrouting0
132     date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
133     location_dest_id: stock.stock_location_stock
134     location_src_id: stock.stock_location_stock
135 -
136   I compute the data of production order.
137 -
138   !python {model: mrp.production}: |
139     self.action_compute(cr, uid, [ref("mrp_production_mo0")], {"lang": "en_US", "tz": False, "search_default_Current":
140       1, "active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
141       "active_id": ref("mrp.menu_mrp_production_action"), })
142 -
143   I confirm the production order.
144 -
145   !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0}
146 -
147   I check that all three stock moves have the destination location which is set in routing instead of the default one.
148 -
149   !python {model: mrp.production}: |
150     production = self.browse(cr, uid, [ref("mrp_production_mo0")])
151     route_location_id = production[0].routing_id.location_id.id
152     for move in production[0].move_lines:
153       assert (move.location_id.id == route_location_id),'Wrong Move !'