fix: setup fails to set abbr to departments

(cherry picked from commit debe868950)
This commit is contained in:
Mihir Kandoi
2026-02-17 21:07:30 +05:30
committed by Mergify
parent 128c2bf8b9
commit c432506912

View File

@@ -30,8 +30,7 @@ class Department(NestedSet):
nsm_parent_field = "parent_department"
def autoname(self):
root = get_root_of("Department")
if root and self.department_name != root:
if self.company:
self.name = get_abbreviated_name(self.department_name, self.company)
else:
self.name = self.department_name