mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
[minor] fixed patch item template attributes
This commit is contained in:
@@ -65,6 +65,12 @@ def migrate_item_variants():
|
|||||||
item_attributes = frappe.db.sql("""select distinct item_attribute, item_attribute_value
|
item_attributes = frappe.db.sql("""select distinct item_attribute, item_attribute_value
|
||||||
from `tabItem Variant` where parent=%s""", item.name)
|
from `tabItem Variant` where parent=%s""", item.name)
|
||||||
|
|
||||||
|
if not item_attributes and not all_variants:
|
||||||
|
item = frappe.get_doc("Item", item.name)
|
||||||
|
item.has_variants = 0
|
||||||
|
item.save()
|
||||||
|
continue
|
||||||
|
|
||||||
attribute_value_options = {}
|
attribute_value_options = {}
|
||||||
for attribute, value in item_attributes:
|
for attribute, value in item_attributes:
|
||||||
attribute_value_options.setdefault(attribute, []).append(value)
|
attribute_value_options.setdefault(attribute, []).append(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user