validation fix
This commit is contained in:
parent
2b885beaee
commit
5f779eb805
@ -589,8 +589,10 @@ def validate_bom_no(item, bom_no):
|
|||||||
if item:
|
if item:
|
||||||
rm_item_exists = False
|
rm_item_exists = False
|
||||||
for d in bom.items:
|
for d in bom.items:
|
||||||
if (d.item_code.lower() == item.lower() or \
|
if (d.item_code.lower() == item.lower()):
|
||||||
d.item_code.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower()):
|
rm_item_exists = True
|
||||||
|
if bom.item.lower() == item.lower() or \
|
||||||
|
bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower():
|
||||||
rm_item_exists = True
|
rm_item_exists = True
|
||||||
if not rm_item_exists:
|
if not rm_item_exists:
|
||||||
frappe.throw(_("BOM {0} does not belong to Item {1}").format(bom_no, item))
|
frappe.throw(_("BOM {0} does not belong to Item {1}").format(bom_no, item))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user