Added check to get_parent_item_groups; if called without an item group, return a default parents list of 'Home' only. (#14811)
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 2f7adb2..230b740 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -156,6 +156,8 @@
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`