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:
parent
58236ffc1e
commit
686284261d
@ -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`
|
||||
|
Loading…
x
Reference in New Issue
Block a user