diff --git a/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py index cfcd288e098..b277ca3c483 100644 --- a/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py @@ -63,8 +63,10 @@ class TestBOMCreator(IntegrationTestCase): fg_valuation_rate = 0 for row in doc.items: - if not row.is_expandable: + if row.fg_item == final_product: fg_valuation_rate += row.amount + + if not row.is_expandable: self.assertEqual(row.fg_item, "Frame Assembly") self.assertEqual(row.fg_reference_id, doc.items[0].name) @@ -105,8 +107,10 @@ class TestBOMCreator(IntegrationTestCase): fg_valuation_rate = 0 for row in doc.items: - if not row.is_expandable: + if row.fg_item == final_product: fg_valuation_rate += row.amount + + if not row.is_expandable: self.assertEqual(row.fg_item, "Bicycle") self.assertEqual(row.fg_reference_id, doc.name) @@ -170,8 +174,10 @@ class TestBOMCreator(IntegrationTestCase): fg_valuation_rate = 0 for row in doc.items: - if not row.is_expandable: + if row.fg_item == final_product: fg_valuation_rate += row.amount + + if not row.is_expandable: self.assertEqual(row.fg_item, "Pedal Assembly") self.assertEqual(row.qty, 2.0) self.assertEqual(row.fg_reference_id, doc.items[0].name)