diff --git a/mrp_bom_attribute_match/tests/test_mrp_bom_attribute_match_nested.py b/mrp_bom_attribute_match/tests/test_mrp_bom_attribute_match_nested.py index 7865fb5d4..a7ef1f2f9 100644 --- a/mrp_bom_attribute_match/tests/test_mrp_bom_attribute_match_nested.py +++ b/mrp_bom_attribute_match/tests/test_mrp_bom_attribute_match_nested.py @@ -81,7 +81,42 @@ class TestMrpBomAttributeMatchNested(TestMrpBomAttributeMatchBase): ) def test_nested(self): + self.env["mrp.routing.workcenter"].create( + [ + { + "name": "Operation 1", + "workcenter_id": self.env.ref("mrp.mrp_workcenter_1").id, + "bom_id": self.bom_top.id, + }, + { + "name": "Operation 2", + "workcenter_id": self.env.ref("mrp.mrp_workcenter_2").id, + "bom_id": self.bom_top.id, + }, + { + "name": "Operation 1", + "workcenter_id": self.env.ref("mrp.mrp_workcenter_1").id, + "bom_id": self.bom_sub.id, + }, + { + "name": "Operation 2", + "workcenter_id": self.env.ref("mrp.mrp_workcenter_2").id, + "bom_id": self.bom_sub.id, + }, + ] + ) BomStructureReport = self.env["report.mrp.report_bom_structure"] - + values_top = BomStructureReport._get_report_values( + self.bom_top.ids, + data={"variant": self.bom_top.product_tmpl_id.product_variant_id.id}, + ) + values_sub = BomStructureReport._get_report_values( + self.bom_sub.ids, + data={"variant": self.bom_sub.product_tmpl_id.product_variant_id.id}, + ) + self.assertIn("Sub Sub 1", str(values_top["docs"][0]["lines"])) + self.assertIn("Sub-Level", str(values_top["docs"][0]["lines"])) + self.assertIn("Sub Sub 1", str(values_sub["docs"][0]["lines"])) + self.assertNotIn("Sub-Level", str(values_sub["docs"][0]["lines"])) BomStructureReport._get_report_data(self.bom_sub.id) BomStructureReport._get_report_data(self.bom_top.id)