From 0d9af60f8aa52f6c244adb16a04e6580ab6f1be9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 10:14:52 +0000 Subject: [PATCH] fix(manufacturing): update non-stock item dict (backport #53689) (#53699) Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com> 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 efcbc5fa9b9..58fce82c208 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -1558,13 +1558,14 @@ def add_non_stock_items_cost(stock_entry, work_order, expense_account, job_card= if work_order and not job_card: table = "exploded_items" if work_order.get("use_multi_level_bom") else "items" - items = {} + items = frappe._dict() for d in bom.get(table): # Phantom item is exploded, so its cost is considered via its components if d.get("is_phantom_item"): continue - 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",