diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 91283c0a2..e5b83f93b 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -86,3 +86,12 @@ class HrContract(models.Model): employee.salary_group_id = contract_id.salary_group_id.id else: employee.salary_group_id = False + + @api.onchange('job_id') + def _compute_job_id(self): + for contract_id in self: + employee = self.env['hr.employee'].search([('id', '=', contract_id.employee_id.id)], limit=1) + if employee: + employee.job_id = contract_id.job_id.id + else: + employee.job_id = False \ No newline at end of file