diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 5a16581d3f7..0d11100ed34 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -871,8 +871,13 @@ class Item(Document): if disabled: frappe.throw(_("Attribute {0} is disabled.").format(frappe.bold(d.attribute))) - if not numeric_values and not frappe.db.exists( - "Item Attribute Value", {"parent": d.attribute, "attribute_value": d.attribute_value} + if ( + not numeric_values + and d.attribute_value + and not frappe.db.exists( + "Item Attribute Value", + {"parent": d.attribute, "attribute_value": d.attribute_value}, + ) ): frappe.throw( _("Attribute Value {0} is not valid for the selected attribute {1}.").format(