[hotfix] check if the item group exist or not

This commit is contained in:
mbauskar 2017-07-10 14:36:42 +05:30
parent 195d2b577f
commit 75a233b472

View File

@ -147,6 +147,7 @@ def invalidate_cache_for(doc, item_group=None):
item_group = doc.name
for d in get_parent_item_groups(item_group):
d = frappe.get_doc("Item Group", d.name)
if d.route:
clear_cache(d.route)
if frappe.db.exists("Item Group", d.get("name")):
d = frappe.get_doc("Item Group", d.get("name"))
if d.route:
clear_cache(d.route)