mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-19 01:25:07 +00:00
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.
This commit is contained in:
@@ -76,7 +76,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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user