[FIX] hr_contract: Allow manager to modify current employee contract

closes odoo/odoo#68259

X-original-commit: c60672e123e996a82a706a8aed5456ddd2288578
Related: odoo/enterprise#17259
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Yannick Tivisse
2021-03-25 10:24:19 +00:00
parent 903453487d
commit 8444643cc6
2 changed files with 6 additions and 2 deletions
+3 -2
View File
@@ -10,8 +10,9 @@ class Employee(models.Model):
vehicle = fields.Char(string='Company Vehicle', groups="hr.group_hr_user")
contract_ids = fields.One2many('hr.contract', 'employee_id', string='Employee Contracts')
contract_id = fields.Many2one('hr.contract', string='Current Contract',
groups="hr.group_hr_user",domain="[('company_id', '=', company_id)]", help='Current contract of the employee')
contract_id = fields.Many2one(
'hr.contract', string='Current Contract', groups="hr.group_hr_user",
domain="[('company_id', '=', company_id), ('employee_id', '=', id)]", help='Current contract of the employee')
calendar_mismatch = fields.Boolean(related='contract_id.calendar_mismatch')
contracts_count = fields.Integer(compute='_compute_contracts_count', string='Contract Count')
contract_warning = fields.Boolean(string='Contract Warning', store=True, compute='_compute_contract_warning', groups="hr.group_hr_user")
@@ -58,6 +58,9 @@
</span>
</div>
</xpath>
<field name="job_id" position="before">
<field name="contract_id" groups="hr_contract.group_hr_contract_manager"/>
</field>
</data>
</field>
</record>