From c0e569dd9040e9712d986fdc9fa8b57cbdb8ca78 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 23 Aug 2021 09:04:15 +0200 Subject: [PATCH] [FIX] hr_timesheet: add compute_sudo for analytic_account_active compute Before this commit, the portal user cannot access to the task form view since he does not have any access to `account.analytic.account` model. This commit adds `compute_sudo=True` in field definition of `analytic_account_active` to bypass the access rights in its compute method. task-2379518 closes #73341 --- addons/hr_timesheet/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/models/project.py b/addons/hr_timesheet/models/project.py index e0d0a09b7df..ca181f12c14 100644 --- a/addons/hr_timesheet/models/project.py +++ b/addons/hr_timesheet/models/project.py @@ -183,7 +183,7 @@ class Task(models.Model): _name = "project.task" _inherit = "project.task" - analytic_account_active = fields.Boolean("Active Analytic Account", compute='_compute_analytic_account_active') + analytic_account_active = fields.Boolean("Active Analytic Account", compute='_compute_analytic_account_active', compute_sudo=True) allow_timesheets = fields.Boolean("Allow timesheets", related='project_id.allow_timesheets', help="Timesheets can be logged on this task.", readonly=True) remaining_hours = fields.Float("Remaining Hours", compute='_compute_remaining_hours', store=True, readonly=True, help="Total remaining time, can be re-estimated periodically by the assignee of the task.") effective_hours = fields.Float("Hours Spent", compute='_compute_effective_hours', compute_sudo=True, store=True, help="Time spent on this task, excluding its sub-tasks.")