From 89b7e11381cfdcc1233f744636a4a76dc0e65d3f Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Thu, 12 Mar 2026 21:16:03 +0530 Subject: [PATCH] chore: phantom qty unused in sub_assembly_items (cherry picked from commit b1e1c65774de7d59d7dee5cc5f38259cdf7dd61d) --- .../doctype/production_plan/production_plan.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index d1153fdddcf..2423dbc1b53 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -2100,9 +2100,6 @@ def get_raw_materials_of_sub_assembly_items( for item in query.run(as_dict=True): key = (item.item_code, item.bom_no) existing_key = (item.item_code, item.bom_no or item.main_bom) - if item.is_phantom_item: - sub_assembly_items.setdefault(key, 0) - sub_assembly_items[key] += item.get("qty") if item.bom_no and not item.is_phantom_item and key not in sub_assembly_items: continue @@ -2111,7 +2108,7 @@ def get_raw_materials_of_sub_assembly_items( continue if item.bom_no: - planned_qty = flt(item.get("qty")) if item.is_phantom_item else flt(sub_assembly_items[key]) + recursion_qty = flt(item.get("qty")) if item.is_phantom_item else flt(sub_assembly_items[key]) get_raw_materials_of_sub_assembly_items( existing_sub_assembly_items, item_details, @@ -2119,7 +2116,7 @@ def get_raw_materials_of_sub_assembly_items( item.bom_no, include_non_stock_items, sub_assembly_items, - planned_qty=planned_qty, + planned_qty=recursion_qty, ) if not item.is_phantom_item: existing_sub_assembly_items.add(existing_key)