From 5604f987f2ad7c79b06b4e8b1fd3407922f43b5e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 31 Dec 2014 12:37:11 +0530 Subject: [PATCH] item validation in bom --- erpnext/manufacturing/doctype/bom/bom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 199ade94c4..bab1b43b60 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):