diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 17ecc66e272..6df95a43395 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -1998,22 +1998,14 @@ def get_reserved_qty_for_production_plan(item_code, warehouse): return reserved_qty_for_production_plan - reserved_qty_for_production -@frappe.request_cache def get_non_completed_production_plans(): table = frappe.qb.DocType("Production Plan") - child = frappe.qb.DocType("Production Plan Item") return ( frappe.qb.from_(table) - .inner_join(child) - .on(table.name == child.parent) .select(table.name) .distinct() - .where( - (table.docstatus == 1) - & (table.status.notin(["Completed", "Closed"])) - & (child.planned_qty > child.ordered_qty) - ) + .where((table.docstatus == 1) & (table.status.notin(["Completed", "Closed"]))) ).run(pluck="name")