From 2f01f96ae3a2876d1d7769b00cd434117731fd10 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 18 Aug 2015 17:52:50 +0530 Subject: [PATCH] [fix] [patch] item template attributes --- erpnext/patches/v5_7/item_template_attributes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v5_7/item_template_attributes.py b/erpnext/patches/v5_7/item_template_attributes.py index 7cbc4ff1946..f0012448530 100644 --- a/erpnext/patches/v5_7/item_template_attributes.py +++ b/erpnext/patches/v5_7/item_template_attributes.py @@ -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():