diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 39c21089f3b..c4b0aa26fce 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -1308,7 +1308,7 @@ def get_material_request_items( required_qty = 0 item_code = row.get("item_code") - if not ignore_existing_ordered_qty or bin_dict.get("projected_qty", 0) < 0: + if ignore_existing_ordered_qty or bin_dict.get("projected_qty", 0) < 0: required_qty = flt(row.get("qty")) else: key = (item_code, warehouse) diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index 20ae8ba6763..5505be3cafa 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -173,7 +173,7 @@ class TestProductionPlan(FrappeTestCase): "company": "_Test Company", "posting_date": nowdate(), "get_items_from": "Sales Order", - "ignore_existing_ordered_qty": 1, + "ignore_existing_ordered_qty": 0, } ) pln.append(