[FIX] analytic: read analytic plan
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) <wan@odoo.com>
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user