diff --git a/erpnext/patches/v5_7/item_template_attributes.py b/erpnext/patches/v5_7/item_template_attributes.py index 9536f1628c..9f141b5b08 100644 --- a/erpnext/patches/v5_7/item_template_attributes.py +++ b/erpnext/patches/v5_7/item_template_attributes.py @@ -72,8 +72,6 @@ def migrate_item_variants(): for attribute, value in item_attributes: attribute_value_options.setdefault(attribute, []).append(value) - save_attributes_in_template(item, attribute_value_options) - possible_combinations = get_possible_combinations(attribute_value_options) for variant in all_variants: @@ -89,6 +87,8 @@ def migrate_item_variants(): save_attributes_in_variant(variant, combination) break + save_attributes_in_template(item, attribute_value_options) + frappe.delete_doc("DocType", "Item Variant") def save_attributes_in_template(item, attribute_value_options):