diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 199ade94c42..bab1b43b60a 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -57,6 +57,9 @@ class BOM(Document): last_purchase_rate, is_manufactured_item from `tabItem` where name=%s""", item_code, as_dict = 1) + if not item: + frappe.throw(_("Item: {0} does not exist in the system").format(item_code)) + return item def validate_rm_item(self, item):