Merge PR #3025 into 16.0

Signed-off-by pedrobaeza
pull/3026/head
OCA-git-bot 2024-09-05 07:02:39 +00:00
commit 7a26491154
1 changed files with 5 additions and 4 deletions

View File

@ -97,12 +97,13 @@ class Base(models.AbstractModel):
}
for field_name, messages in messages_by_field.items()
]
# use sudo as user may not have access to mail.message
record.sudo().message_post_with_view(
# We do not use message_post_with_view() because emails would be sent
rendered_template = self.env["ir.qweb"]._render(
"tracking_manager.track_o2m_m2m_template",
values={"lines": messages},
subtype_id=self.env.ref("mail.mt_note").id,
{"lines": messages, "object": record},
minimal_qcontext=True,
)
record._message_log(body=rendered_template)
def _tm_prepare_o2m_tracking(self):
fnames = self._tm_get_fields_to_track()