fix: incorrect outgoing rates when material_consumption enabled

This commit is contained in:
Noah Jacob 2021-12-03 14:12:00 +05:30
parent 37c318a65f
commit 7f3e6d149a

View File

@ -545,7 +545,7 @@ class StockEntry(StockController):
scrap_items_cost = sum([flt(d.basic_amount) for d in self.get("items") if d.is_scrap_item])
# Get raw materials cost from BOM if multiple material consumption entries
if frappe.db.get_single_value("Manufacturing Settings", "material_consumption", cache=True):
if not outgoing_items_cost and frappe.db.get_single_value("Manufacturing Settings", "material_consumption", cache=True):
bom_items = self.get_bom_raw_materials(finished_item_qty)
outgoing_items_cost = sum([flt(row.qty)*flt(row.rate) for row in bom_items.values()])