[fix] [patch] item template attributes

This commit is contained in:
Anand Doshi 2015-08-18 17:52:50 +05:30
parent 2235caebee
commit 2f01f96ae3

View File

@ -45,8 +45,9 @@ def rename_and_reload_doctypes():
def migrate_manage_variants():
item_attribute = {}
for d in frappe.db.sql("""select DISTINCT va.attribute, i.variant_of from `tabItem Variant Attribute` va, `tabItem` i \
where va.parent = i.name""", as_dict=1):
for d in frappe.db.sql("""select DISTINCT va.attribute, i.variant_of
from `tabItem Variant Attribute` va, `tabItem` i
where va.parent = i.name and ifnull(i.variant_of, '')!=''""", as_dict=1):
item_attribute.setdefault(d.variant_of, []).append({"attribute": d.attribute})
for item, attributes in item_attribute.items():