Skip to content

Commit

Permalink
[IMP]product_configurator_mrp: Parent Bom Type for New Variant of Pro…
Browse files Browse the repository at this point in the history
…duct.
  • Loading branch information
Vandan-OSI committed Jun 5, 2024
1 parent 1662454 commit bc525ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions product_configurator_mrp/models/product_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion product_configurator_mrp/tests/test_mrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions product_configurator_mrp/wizard/product_configurator_mrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc525ee

Please sign in to comment.