Merge pull request #19853 from rohitwaghchaure/fixed_production_plan_items_required_to_pull_mr
fix: 'NoneType' object is not iterable
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 25c385f..8876253 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -615,6 +615,9 @@
doc['mr_items'] = []
po_items = doc.get('po_items') if doc.get('po_items') else doc.get('items')
+ if not po_items:
+ frappe.throw(_("Items are required to pull the raw materials which is associated with it."))
+
company = doc.get('company')
warehouse = doc.get('for_warehouse')