fix: Added description if item variants does not have description in map(v12) (#17796)

* fix: variant item description based on attribute

* style: removed unwanted changes
This commit is contained in:
Anurag Mishra 2019-05-30 14:04:08 +05:30 committed by GitHub
parent 9944ef2baf
commit 62d58acea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,14 +279,14 @@ 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 'description' not in allow_fields:
if not variant.description:
variant.description = ""
if item.variant_based_on=='Item Attribute':
if variant.attributes:
attributes_description = ""
attributes_description = item.description + " "
for d in variant.attributes:
attributes_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"