department_managers = []
for record in self:
departments = record.env['hr.department'].search([('active','=',True),('is_in_use','=', True)])
for department in departments:
if department.manager_id:
department_managers.append(department.manager_id.id)
if record.employee_id.id in department_managers:
record[x_sfzzdyjj] = "1"
else:
record[x_sfzzdyjj] = "2"