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() for field_name, messages in messages_by_field.items()
] ]
# use sudo as user may not have access to mail.message # We do not use message_post_with_view() because emails would be sent
record.sudo().message_post_with_view( rendered_template = self.env["ir.qweb"]._render(
"tracking_manager.track_o2m_m2m_template", "tracking_manager.track_o2m_m2m_template",
values={"lines": messages}, {"lines": messages, "object": record},
subtype_id=self.env.ref("mail.mt_note").id, minimal_qcontext=True,
) )
record._message_log(body=rendered_template)
def _tm_prepare_o2m_tracking(self): def _tm_prepare_o2m_tracking(self):
fnames = self._tm_get_fields_to_track() fnames = self._tm_get_fields_to_track()