diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index 646f23879a9..31ae83a0ce2 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -287,19 +287,15 @@ def copy_attributes_to_variant(item, variant): variant.set(field.fieldname, item.get(field.fieldname)) variant.variant_of = item.name - if 'description' in allow_fields: - variant.has_variants = 0 - if not variant.description: - variant.description = "" - if item.variant_based_on=='Item Attribute': - if variant.attributes: - attributes_description = "" - for d in variant.attributes: - attributes_description += "
" + d.attribute + ": " + cstr(d.attribute_value) + "
" + if not variant.description: + variant.description = "" - if attributes_description not in variant.description: - variant.description += attributes_description + if 'description' not in allow_fields: + if item.variant_based_on == 'Item Attribute' and not variant.description: + variant.description = "
" + item.name + "
" + for d in variant.attributes: + variant.description += "
" + d.attribute + ": " + cstr(d.attribute_value) + "
" 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"""