From 9ba5614761f882cda86ddc303d4c5d5ac0937968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 29 Aug 2024 10:51:13 +0200 Subject: [PATCH] [FIX] project_timesheet_time_control: Avoid access error with ir.model Only "advanced" users have read access to ir.model, for this reason, we need to apply .sudo() --- .../models/hr_timesheet_time_control_mixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_timesheet_time_control/models/hr_timesheet_time_control_mixin.py b/project_timesheet_time_control/models/hr_timesheet_time_control_mixin.py index 799a90222c..ca8fb826d8 100644 --- a/project_timesheet_time_control/models/hr_timesheet_time_control_mixin.py +++ b/project_timesheet_time_control/models/hr_timesheet_time_control_mixin.py @@ -64,7 +64,7 @@ def button_end_work(self): self._timesheet_running_domain(), ) if not running_lines: - model = self.env["ir.model"].search([("model", "=", self._name)]) + model = self.env["ir.model"].sudo().search([("model", "=", self._name)]) message = _( "No running timer found in %(model)s %(record)s. " "Refresh the page and check again."