diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 760b20a4765..bb357d8bf83 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -27,7 +27,7 @@ class ItemGroup(NestedSet, WebsiteGenerator): def validate(self): super(ItemGroup, self).validate() - if not self.parent_item_group: + if not self.parent_item_group and not frappe.flags.in_test: self.parent_item_group = 'All Item Groups' self.make_route()