[fix] BOM item validation in lower case

This commit is contained in:
Nabin Hait 2015-05-27 16:52:06 +05:30
parent 148386f73e
commit d9d5925f14

View File

@ -424,6 +424,6 @@ def validate_bom_no(item, bom_no):
if bom.docstatus != 1:
if not getattr(frappe.flags, "in_test", False):
frappe.throw(_("BOM {0} must be submitted").format(bom_no))
if item and not (bom.item == item or \
bom.item == frappe.db.get_value("Item", item, "variant_of")):
if item and not (bom.item.lower() == item.lower() or \
bom.item.lower() == frappe.db.get_value("Item", item, "variant_of").lower()):
frappe.throw(_("BOM {0} does not belong to Item {1}").format(bom_no, item))