[fix] Do not append description to variant if description already exists (#11204)
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 513b97f..8ca4f70 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -205,9 +205,10 @@
if item.variant_based_on=='Item Attribute':
if variant.attributes:
- variant.description += "\n"
- for d in variant.attributes:
- variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
+ if not variant.description:
+ variant.description += "\n"
+ for d in variant.attributes:
+ variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
def make_variant_item_code(template_item_code, template_item_name, variant):
"""Uses template's item code and abbreviations to make variant's item code"""