From c938db02d0b73fa15b536c8918370e54e07fc795 Mon Sep 17 00:00:00 2001 From: Phil Gaiser Date: Thu, 29 Jun 2023 15:51:44 +0200 Subject: [PATCH] [FIX] base_comment_template: Fix access error. Fix an access error in the base_comment_template module in the BaseCommentTemplate.name_get() method. Add sudo() before reading ir_model.name fields to fix access error for users without admin rights when opening contact form views. --- base_comment_template/models/base_comment_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_comment_template/models/base_comment_template.py b/base_comment_template/models/base_comment_template.py index 316c2201b1..9f95c58560 100644 --- a/base_comment_template/models/base_comment_template.py +++ b/base_comment_template/models/base_comment_template.py @@ -113,7 +113,7 @@ def name_get(self): item.name, dict(self._fields["position"].selection).get(item.position) ) if self.env.context.get("comment_template_model_display"): - name += " (%s)" % ", ".join(item.model_ids.mapped("name")) + name += " (%s)" % ", ".join(item.sudo().model_ids.mapped("name")) res.append((item.id, name)) return res