do not copy template description to variant if not in allow fields (#13726)
This commit is contained in:
parent
9738d52d5f
commit
38de994788
@ -272,18 +272,19 @@ def copy_attributes_to_variant(item, variant):
|
|||||||
else:
|
else:
|
||||||
variant.set(field.fieldname, item.get(field.fieldname))
|
variant.set(field.fieldname, item.get(field.fieldname))
|
||||||
|
|
||||||
variant.variant_of = item.name
|
if 'description' in allow_fields:
|
||||||
variant.has_variants = 0
|
variant.variant_of = item.name
|
||||||
if not variant.description:
|
variant.has_variants = 0
|
||||||
variant.description = ""
|
if not variant.description:
|
||||||
|
variant.description = ""
|
||||||
|
|
||||||
if item.variant_based_on=='Item Attribute':
|
if item.variant_based_on=='Item Attribute':
|
||||||
if variant.attributes:
|
if variant.attributes:
|
||||||
attributes_description = ""
|
attributes_description = ""
|
||||||
for d in variant.attributes:
|
for d in variant.attributes:
|
||||||
attributes_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
|
attributes_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
|
||||||
|
|
||||||
if attributes_description not in variant.description:
|
if attributes_description not in variant.description:
|
||||||
variant.description += attributes_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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user