Update variant description based on attribute if not already there (#11302)
This commit is contained in:
parent
311823aca1
commit
82c9352d53
@ -201,14 +201,16 @@ def copy_attributes_to_variant(item, variant):
|
|||||||
variant.variant_of = item.name
|
variant.variant_of = item.name
|
||||||
variant.has_variants = 0
|
variant.has_variants = 0
|
||||||
if not variant.description:
|
if not variant.description:
|
||||||
variant.description = ''
|
variant.description = ""
|
||||||
|
|
||||||
if item.variant_based_on=='Item Attribute':
|
if item.variant_based_on=='Item Attribute':
|
||||||
if variant.attributes:
|
if variant.attributes:
|
||||||
if not variant.description:
|
attributes_description = ""
|
||||||
variant.description += "\n"
|
for d in variant.attributes:
|
||||||
for d in variant.attributes:
|
attributes_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
|
||||||
variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
|
|
||||||
|
if attributes_description not in variant.description:
|
||||||
|
variant.description += attributes_description
|
||||||
|
|
||||||
def make_variant_item_code(template_item_code, template_item_name, variant):
|
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"""
|
"""Uses template's item code and abbreviations to make variant's item code"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user