From c0ce34e12cb17c94af0192084897ea2a962a2f4a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 10:26:29 +0000 Subject: [PATCH] fix(manufacturing): update non-stock item dict (backport #53689) (#53698) Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com> Co-authored-by: Mihir Kandoi fix(manufacturing): update non-stock item dict (#53689) --- erpnext/manufacturing/doctype/bom/bom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 510d4f511dd..0fa17d34d51 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -1335,9 +1335,10 @@ def add_non_stock_items_cost(stock_entry, work_order, expense_account): bom = frappe.get_doc("BOM", work_order.bom_no) table = "exploded_items" if work_order.get("use_multi_level_bom") else "items" - items = {} + items = frappe._dict() for d in bom.get(table): - items.setdefault(d.item_code, d.amount) + items.setdefault(d.item_code, 0) + items[d.item_code] += flt(d.amount) non_stock_items = frappe.get_all( "Item",