From 35898d751804b38e94226f79a095aa161bb6fdfb Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 16 Feb 2015 17:25:28 +0530 Subject: [PATCH] Update finished goods fix --- erpnext/stock/doctype/stock_entry/stock_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 4faa644d47..93b617c303 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -285,7 +285,7 @@ class StockEntry(StockController): if flt(d.completed_qty): operation_cost_per_unit += flt(d.actual_operating_cost) / flt(d.completed_qty) else: - operation_cost_per_unit += flt(d.planned_operating_cost) / flt(self.qty) + operation_cost_per_unit += flt(d.planned_operating_cost) / flt(pro_order.qty) if not operation_cost_per_unit and bom_no: bom = frappe.db.get_value("BOM", bom_no, ["operating_cost", "quantity"], as_dict=1)