From ec109334c5ca8e60e8d921afb0d421e0ac5f0690 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Wed, 19 Oct 2022 09:26:53 +0000 Subject: [PATCH] [FIX] hr_work_entry_contract: allow Payroll Manager to access work entries A Payroll Manager couldn't access the work entries of their own employees as they couldn't write the work entries generation date on the employee's contract. task-3014915 closes odoo/odoo#104113 X-original-commit: d6a5909f988568581c2ec5b3f83271863be85fc4 Signed-off-by: Kevin Baptiste --- addons/hr_work_entry_contract/models/hr_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_work_entry_contract/models/hr_employee.py b/addons/hr_work_entry_contract/models/hr_employee.py index 235c6e6317b..0cc54a071fe 100644 --- a/addons/hr_work_entry_contract/models/hr_employee.py +++ b/addons/hr_work_entry_contract/models/hr_employee.py @@ -24,6 +24,6 @@ class HrEmployee(models.Model): contracts_by_company[contract.company_id] |= contract for company, contracts in contracts_by_company.items(): - new_work_entries = bool(contracts.with_company(company)._generate_work_entries( + new_work_entries = bool(contracts.with_company(company).sudo()._generate_work_entries( date_start, date_stop, force)) or new_work_entries return new_work_entries