Added check to get_parent_item_groups; if called without an item group, return a default parents list of 'Home' only. (#14811)

This commit is contained in:
Andrew McLeod 2018-07-06 06:11:37 +01:00 committed by Nabin Hait
parent 58236ffc1e
commit 686284261d

View File

@ -156,6 +156,8 @@ def get_group_item_count(item_group):
def get_parent_item_groups(item_group_name):
if not item_group_name:
return [{"name": frappe._("Home"), "route":"/"}]
item_group = frappe.get_doc("Item Group", item_group_name)
return [{"name": frappe._("Home"), "route":"/"}]+\
frappe.db.sql("""select name, route from `tabItem Group`