mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: single variant creation error
This commit is contained in:
@@ -889,8 +889,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(
|
||||
|
||||
Reference in New Issue
Block a user