mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix: do not translate root Item Group lookup key (backport #57390)
The root Item Group is looked up by its untranslated name. (cherry picked from commit7239e6ed8c) (cherry picked from commitd197d5685e)
This commit is contained in:
@@ -33,8 +33,11 @@ class ItemGroup(NestedSet):
|
||||
|
||||
def validate(self):
|
||||
if not self.parent_item_group and not frappe.flags.in_test:
|
||||
if frappe.db.exists("Item Group", _("All Item Groups")):
|
||||
self.parent_item_group = _("All Item Groups")
|
||||
root = frappe.db.get_value(
|
||||
"Item Group", {"parent_item_group": ("is", "not set"), "is_group": 1}, order_by="lft asc"
|
||||
)
|
||||
if root and root != self.name:
|
||||
self.parent_item_group = root
|
||||
self.validate_item_group_defaults()
|
||||
self.check_item_tax()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user