diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index e081d433111ec39fb19e11809357f11d1106d61a..b819ffb1a1fb18873f492247b91de043205ed331 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -352,7 +352,7 @@ class ProductionPlan(Document): so_item.parent, so_item.item_code, so_item.warehouse, - so_item.qty, + (so_item.stock_qty - so_item.stock_reserved_qty).as_("qty"), so_item.work_order_qty, so_item.delivered_qty, so_item.conversion_factor, @@ -364,7 +364,7 @@ class ProductionPlan(Document): .where( (so_item.parent.isin(so_list)) & (so_item.docstatus == 1) - & (so_item.qty > so_item.work_order_qty) + & ((so_item.stock_qty - so_item.stock_reserved_qty) > so_item.work_order_qty) ) )