Skip to content
Snippets Groups Projects
Commit d6568e0b authored by Antoine Guenet's avatar Antoine Guenet
Browse files

[FIX] mass_mailing: preserve comments when testing a mailing


When sending a mailing we make sure to preserve comments (in particular
so that MSO comments can be read by Outlook). However this was not the
case when testing a mailing using the Test button in the form view.

task-3488162
opw-3290548
opw-3479234

closes odoo/odoo#133754

Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
parent dde30798
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ class TestMassMailing(models.TransientModel):
# Downside: Qweb syntax is only tested when there is atleast one record of the mailing's model
if record:
# Returns a proper error if there is a syntax error with Qweb
body = mailing._render_field('body_html', record.ids, post_process=True)[record.id]
body = mailing.with_context(preserve_comments=True)._render_field('body_html', record.ids, post_process=True)[record.id]
preview = mailing._render_field('preview', record.ids, post_process=True)[record.id]
full_body = mailing._prepend_preview(Markup(body), preview)
subject = mailing._render_field('subject', record.ids)[record.id]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment