From 502189913a5339bd43ea166457ab70b65bfc7bf3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 7 Dec 2019 14:10:11 +0530 Subject: [PATCH] fix: 'NoneType' object is not iterable --- .../manufacturing/doctype/production_plan/production_plan.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 25c385fb1e..8876253e8e 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -615,6 +615,9 @@ def get_items_for_material_requests(doc, ignore_existing_ordered_qty=None): 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')