move bom based rate calculation to end (#9271)

This commit is contained in:
Sagar Vora 2017-06-14 12:38:27 +05:30 committed by Nabin Hait
parent 489ab6d70d
commit 99a2db80ab

View File

@ -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):