Fix for Issue #4543: Suffix now uses attribute abbreviation if it exists or value for numeric attributes
This commit is contained in:
parent
096fc88200
commit
d46abb49f3
@ -34,7 +34,8 @@ class Item(WebsiteGenerator):
|
|||||||
if self.variant_of:
|
if self.variant_of:
|
||||||
item_code_suffix = ""
|
item_code_suffix = ""
|
||||||
for attribute in self.attributes:
|
for attribute in self.attributes:
|
||||||
item_code_suffix += "-" + str(attribute.attribute_value)
|
attribute_abbr = frappe.db.get_value("Item Attribute Value", {"parent": attribute.attribute, "attribute_value": attribute.attribute_value}, "abbr")
|
||||||
|
item_code_suffix += "-" + str(attribute_abbr or attribute.attribute_value)
|
||||||
self.item_code = str(self.variant_of) + item_code_suffix
|
self.item_code = str(self.variant_of) + item_code_suffix
|
||||||
else:
|
else:
|
||||||
from frappe.model.naming import make_autoname
|
from frappe.model.naming import make_autoname
|
||||||
|
Loading…
Reference in New Issue
Block a user