代码:
the_dep = self.new_department_id
for i in range(5):
the_dep = the_dep.parent_department_id
if i == 0:
if the_dep:
result = the_dep.manager_id.user_id
break
===========
result = False
if self.department_id and self.new_department_id:
if self.department_id.id==self.new_department_id.id:
result = True
代码:
the_dep = self.new_department_id
for i in range(5):
the_dep = the_dep.parent_department_id
if i == 0:
if the_dep:
result = the_dep.manager_id.user_id
break
===========
result = False
if self.department_id and self.new_department_id:
if self.department_id.id==self.new_department_id.id:
result = True