mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 06:48:31 +00:00
Fix for Issue #4543: Suffix now uses attribute abbreviation if it exists or value for numeric attributes
This commit is contained in:
@@ -34,7 +34,8 @@ class Item(WebsiteGenerator):
|
||||
if self.variant_of:
|
||||
item_code_suffix = ""
|
||||
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
|
||||
else:
|
||||
from frappe.model.naming import make_autoname
|
||||
|
||||
Reference in New Issue
Block a user