diff --git a/product_configurator_mrp/models/product_config.py b/product_configurator_mrp/models/product_config.py index 7fa23dbbc..7c603c25f 100644 --- a/product_configurator_mrp/models/product_config.py +++ b/product_configurator_mrp/models/product_config.py @@ -46,6 +46,7 @@ def create_get_bom(self, variant, product_tmpl_id=None, values=None): order="sequence asc", limit=1, ) + bom_type = parent_bom and parent_bom.type or "normal" bom_lines = [] if not parent_bom: # If not Bom, then Cycle through attributes to add their @@ -113,6 +114,7 @@ def create_get_bom(self, variant, product_tmpl_id=None, values=None): bom_values = { "product_tmpl_id": self.product_tmpl_id.id, "product_id": variant.id, + "type": bom_type, "bom_line_ids": bom_lines, } specs = self.get_onchange_specifications(model="mrp.bom") diff --git a/product_configurator_mrp/tests/test_mrp.py b/product_configurator_mrp/tests/test_mrp.py index 18688b9ef..e25c1a3c2 100644 --- a/product_configurator_mrp/tests/test_mrp.py +++ b/product_configurator_mrp/tests/test_mrp.py @@ -10,7 +10,7 @@ class TestMrp(ProductConfiguratorTestCases): def setUp(self): - super(TestMrp, self).setUp() + super().setUp() self.mrpBomConfigSet = self.env["mrp.bom.line.configuration.set"] self.mrpBomConfig = self.env["mrp.bom.line.configuration"] self.mrpBom = self.env["mrp.bom"] diff --git a/product_configurator_mrp/wizard/product_configurator_mrp.py b/product_configurator_mrp/wizard/product_configurator_mrp.py index 65a907799..167aad464 100644 --- a/product_configurator_mrp/wizard/product_configurator_mrp.py +++ b/product_configurator_mrp/wizard/product_configurator_mrp.py @@ -78,9 +78,9 @@ def action_config_done(self): return res model_name = "mrp.production" line_vals = self._get_order_vals(res["res_id"]) - mrpProduction = self.env[model_name] + # mrpProduction = self.env[model_name] cfg_session = self.config_session_id - specs = cfg_session.get_onchange_specifications(model=model_name) + # specs = cfg_session.get_onchange_specifications(model=model_name) # updates = mrpProduction.onchange(line_vals, ["bom_id"], specs) # values = updates.get("value", {}) # values = cfg_session.get_vals_to_write(values=values, model=model_name)