diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 2cf2f409f0..bbfdc9a337 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -138,8 +138,6 @@ class BOM(WebsiteGenerator): if arg.get('scrap_items'): rate = self.get_valuation_rate(arg) - elif arg['bom_no']: - rate = self.get_bom_unitcost(arg['bom_no']) elif arg: if self.rm_cost_as_per == 'Valuation Rate': rate = self.get_valuation_rate(arg) @@ -151,6 +149,9 @@ class BOM(WebsiteGenerator): rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list, "item_code": arg["item_code"]}, "price_list_rate") or 0 + if not rate and arg['bom_no']: + rate = self.get_bom_unitcost(arg['bom_no']) + return rate def update_cost(self):