From 347dd08342bdffd743e56357b54f4a5e35be6cf8 Mon Sep 17 00:00:00 2001 From: Philippe Wauthy Date: Wed, 2 Nov 2022 09:10:11 +0000 Subject: [PATCH] [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 --- addons/hr_contract/models/hr_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_contract/models/hr_employee.py b/addons/hr_contract/models/hr_employee.py index bbc07be5ddf..7b8d0af669b 100644 --- a/addons/hr_contract/models/hr_employee.py +++ b/addons/hr_contract/models/hr_employee.py @@ -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')