From 70abc5d08372e678a23f6c8f48fc4add784dd4ed Mon Sep 17 00:00:00 2001 From: "Abdelouahab (abla)" Date: Mon, 18 Dec 2023 15:18:00 +0100 Subject: [PATCH] [FIX] analytic: read analytic plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To reproduce ============ Users in a newly created database are not able to create new projects that has timesheet enabled Problem ======= when creating a project with timesheet, an analytic account is created which requires reading `analytic.plan` which leads to the access error Solution ======== read `analytic.plan` through `sudo` opw-3642817 closes odoo/odoo#146769 Signed-off-by: William André (wan) --- addons/analytic/models/analytic_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/analytic/models/analytic_plan.py b/addons/analytic/models/analytic_plan.py index 58347728e2f..803626bf7c3 100644 --- a/addons/analytic/models/analytic_plan.py +++ b/addons/analytic/models/analytic_plan.py @@ -129,7 +129,7 @@ class AccountAnalyticPlan(models.Model): @api.depends('parent_id', 'parent_path') def _compute_root_id(self): - for plan in self: + for plan in self.sudo(): plan.root_id = int(plan.parent_path[:-1].split('/')[0]) if plan.parent_path else plan @api.depends('name', 'parent_id.complete_name')