commit | fdcfe180adf7f2abf960c38a6c136d12a1aa1fb7 | [log] [tgz] |
---|---|---|
author | Kanchan Chauhan <angel143.dr@gmail.com> | Mon Nov 21 11:29:18 2016 +0530 |
committer | Kanchan Chauhan <angel143.dr@gmail.com> | Mon Nov 21 11:29:18 2016 +0530 |
tree | 08aa6b7e848d6439048a7c8f1a23fc051f0246da | |
parent | 535462fc2055d26ec6d196af907529e4b1c8252b [diff] |
[Fix] Better error message if default BOM not found
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 3934935..e0a6311 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -466,6 +466,9 @@ if variant_of: res["bom_no"] = frappe.db.get_value("BOM", filters={"item": variant_of, "is_default": 1}) + if not res["bom_no"]: + frappe.throw(_("Default BOM for {0} not found").format(item)) + res.update(check_if_scrap_warehouse_mandatory(res["bom_no"])) return res