mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-20 23:35:11 +00:00
Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com> fix(manufacturing): update non-stock item dict (#53689)
This commit is contained in:
@@ -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:
|
if work_order and not job_card:
|
||||||
table = "exploded_items" if work_order.get("use_multi_level_bom") else "items"
|
table = "exploded_items" if work_order.get("use_multi_level_bom") else "items"
|
||||||
|
|
||||||
items = {}
|
items = frappe._dict()
|
||||||
for d in bom.get(table):
|
for d in bom.get(table):
|
||||||
# Phantom item is exploded, so its cost is considered via its components
|
# Phantom item is exploded, so its cost is considered via its components
|
||||||
if d.get("is_phantom_item"):
|
if d.get("is_phantom_item"):
|
||||||
continue
|
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(
|
non_stock_items = frappe.get_all(
|
||||||
"Item",
|
"Item",
|
||||||
|
|||||||
Reference in New Issue
Block a user