termination_ids = env['hr.termination'].search(cr, 1, [],order='id')
dimission_ids = env['employee.dimission'].search(cr, 1, [],order='id')
for termination in termination_ids:
termination_obj = env['hr.termination'].browse(cr, 1, termination)
if termination_obj.state in ['waiting','processing'] and termination_obj.active:
termination_obj.employee_id.write(
{'x_czztlzd':True}
)
else:
termination_obj.employee_id.write(
{'x_czztlzd':False}
)
for dimission in dimission_ids:
dimission_obj = env['employee.dimission'].browse(cr, 1, dimission)
if dimission_obj.state in ['waiting','processing'] and dimission_obj.active:
dimission_obj.employee_id.write(