diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 6b87cf3dbd..d17adf6369 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -567,12 +567,8 @@ def get_items_for_material_requests(doc, sales_order=None, company=None): else: item_details = get_subitems(doc, data, item_details, bom_no, company, include_non_stock_items, include_subcontracted_items, 1, planned_qty=planned_qty) - else: - if data['item_code']: - item_master = frappe.get_doc('Item', data['item_code']).as_dict() - else: - frappe.throw(_("Please select items first")) - + elif data.get('item_code'): + item_master = frappe.get_doc('Item', data['item_code']).as_dict() purchase_uom = item_master.purchase_uom or item_master.stock_uom conversion_factor = 0 for d in item_master.get("uoms"):