mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[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.
This commit is contained in:
@@ -113,7 +113,7 @@ class BaseCommentTemplate(models.Model):
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user