department = self.employee_id.department_id
result = False
while department:
if department.code == '10001000':
result = True
break
else:
department = department.parent_department_id
while department:
if department.code == '10009000':
result = False
break
else:
department = department.parent_department_id
department = self.employee_id.department_id
result = False
while department:
if department.code == '10001000':
result = True
break
else:
department = department.parent_department_id
while department:
if department.code == '10009000':
result = False
break
else:
department = department.parent_department_id