Skip to content

Commit

Permalink
fix(Item Group): allow root deletion
Browse files Browse the repository at this point in the history
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 fd2c272)
  • Loading branch information
barredterra authored and mergify[bot] committed Jul 27, 2023
1 parent dc603c3 commit 1a6be5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/setup/doctype/item_group/item_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def make_route(self):
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()

Expand Down

0 comments on commit 1a6be5e

Please sign in to comment.