Skip to content

Commit b15db05

Browse files
mihir-kandoimergify[bot]
authored andcommitted
fix: setup fails to set abbr to departments
(cherry picked from commit debe868)
1 parent 10be8f1 commit b15db05

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

erpnext/setup/doctype/department/department.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class Department(NestedSet):
3232
nsm_parent_field = "parent_department"
3333

3434
def autoname(self):
35-
root = get_root_of("Department")
36-
if root and self.department_name != root:
35+
if self.company:
3736
self.name = get_abbreviated_name(self.department_name, self.company)
3837
else:
3938
self.name = self.department_name

0 commit comments

Comments
 (0)