Skip to content

Commit

Permalink
[FIX] base_comment_template: Fix access error.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BT-pgaiser committed Jul 4, 2023
1 parent c71db28 commit c938db0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base_comment_template/models/base_comment_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c938db0

Please sign in to comment.