From 1a6be5e19bf5d0aea9e456d18e51b19b43013690 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:01:57 +0200 Subject: [PATCH] fix(Item Group): allow root deletion It was not possible to delete an empty, unused Item Group without any children, if it was one of possibly multiple roots of the Item Group tree. This fix allows deleting a root Item Group. (cherry picked from commit fd2c272bed6f1b59b5e7cbb3d381ae1e66168046) --- erpnext/setup/doctype/item_group/item_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index e96c8541f40..cc67c696b43 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -73,7 +73,7 @@ class ItemGroup(NestedSet, WebsiteGenerator): return self.route def on_trash(self): - NestedSet.on_trash(self) + NestedSet.on_trash(self, allow_root_deletion=True) WebsiteGenerator.on_trash(self) self.delete_child_item_groups_key()