From 32e7aca3dcabe16b3ff59a4937316c1a1971948a Mon Sep 17 00:00:00 2001 From: Saran440 Date: Wed, 12 Jul 2023 16:53:22 +0700 Subject: [PATCH] [FIX] account_tag_dimension: fix permission sudo - Allow modify model 'ir.model' --- analytic_tag_dimension/models/account_analytic_dimension.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/analytic_tag_dimension/models/account_analytic_dimension.py b/analytic_tag_dimension/models/account_analytic_dimension.py index 533aa53689..253bc19562 100644 --- a/analytic_tag_dimension/models/account_analytic_dimension.py +++ b/analytic_tag_dimension/models/account_analytic_dimension.py @@ -57,8 +57,10 @@ def _update_invoice_report(self, field_to_update, value): @api.model def create(self, values): res = super().create(values) - _models = self.env["ir.model"].search( - [("model", "in", self.get_model_names())], order="id" + _models = ( + self.env["ir.model"] + .sudo() + .search([("model", "in", self.get_model_names())], order="id") ) _models.write( {