2 I create Bill of Materials with one service type product and one consumable product.
4 !record {model: mrp.bom, id: mrp_bom_test1}:
5 company_id: base.main_company
6 name: PC Assemble SC234
7 product_id: product.product_product_3
11 - company_id: base.main_company
12 name: On Site Assistance
13 product_id: product.product_product_2
15 - company_id: base.main_company
16 name: GrapWorks Software
17 product_id: product.product_product_44
20 I make the production order using BoM having one service type product and one consumable product.
22 !record {model: mrp.production, id: mrp_production_servicetype_mo1}:
23 product_id: product.product_product_3
26 date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
28 I compute the data of production order.
30 !python {model: mrp.production}: |
31 self.action_compute(cr, uid, [ref("mrp_production_servicetype_mo1")], {"lang": "en_US", "tz": False, "search_default_Current": 1,
32 "active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
33 "active_id": ref("mrp.menu_mrp_production_action"), })
35 I confirm the production order.
37 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_servicetype_mo1}
39 I reserved the product.
41 !python {model: mrp.production}: |
42 order = self.browse(cr, uid, ref("mrp_production_servicetype_mo1"))
43 assert order.state == 'confirmed', "Production order should be confirmed."
44 self.force_production(cr, uid, [order.id])
49 !python {model: mrp.product.produce}: |
50 context.update({'active_id': ref('mrp_production_servicetype_mo1')})
52 !record {model: mrp.product.produce, id: mrp_product_produce_1}:
53 mode: 'consume_produce'
55 !python {model: mrp.product.produce}: |
56 self.do_produce(cr, uid, [ref('mrp_product_produce_1')], context=context)
58 I check production order after produced.
60 !python {model: mrp.production}: |
61 order = self.browse(cr, uid, ref("mrp_production_servicetype_mo1"))
62 assert order.state == 'done', "Production order should be closed."
64 I create Bill of Materials with two service type products.
66 !record {model: mrp.bom, id: mrp_bom_test_2}:
67 company_id: base.main_company
68 name: PC Assemble SC234
69 product_id: product.product_product_3
73 - company_id: base.main_company
74 name: On Site Monitoring
75 product_id: product.product_product_1
77 - company_id: base.main_company
78 name: On Site Assistance
79 product_id: product.product_product_2
82 I make the production order using BoM having two service type products.
84 !record {model: mrp.production, id: mrp_production_servicetype_2}:
85 product_id: product.product_product_3
87 bom_id: mrp_bom_test_2
88 date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
90 I compute the data of production order.
92 !python {model: mrp.production}: |
93 self.action_compute(cr, uid, [ref("mrp_production_servicetype_2")], {"lang": "en_US", "tz": False, "search_default_Current": 1,
94 "active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
95 "active_id": ref("mrp.menu_mrp_production_action"), })
97 I confirm the production order.
99 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_servicetype_2}
101 Now I start production.
103 !workflow {model: mrp.production, action: button_produce, ref: mrp_production_servicetype_2}
105 I check that production order in production state after start production.
107 !python {model: mrp.production}: |
108 order = self.browse(cr, uid, ref("mrp_production_servicetype_2"))
109 assert order.state == 'in_production', 'Production order should be in production State.'
113 !python {model: mrp.product.produce}: |
114 context.update({'active_id': ref('mrp_production_servicetype_2')})
116 !record {model: mrp.product.produce, id: mrp_product_produce_2}:
117 mode: 'consume_produce'
119 !python {model: mrp.product.produce}: |
120 self.do_produce(cr, uid, [ref('mrp_product_produce_2')], context=context)
122 I check production order after produced.
124 !python {model: mrp.production}: |
125 order = self.browse(cr, uid, ref("mrp_production_servicetype_2"))
126 assert order.state == 'done', "Production order should be closed."