[FIX] hr_contract: add group on contract_id field

Add the hr_contract.group_hr_contract_employee_manager group on the contract_id field in hr_employee
to avoid having an access error once a user with Manager security group in Payroll tries to open the
Payroll app.

task-3053032

closes odoo/odoo#105753

X-original-commit: fa1b4f14257ca04c85c7541fd94b19dff939626c
Related: odoo/enterprise#33942
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Philippe Wauthy
2022-11-15 16:16:48 +01:00
parent 90b73796bc
commit 347dd08342
+1 -1
View File
@@ -12,7 +12,7 @@ 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",
'hr.contract', string='Current Contract', groups="hr.group_hr_user,hr_contract.group_hr_contract_employee_manager",
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')