[FIX] mass_mailing: fix batch call of action_send_mail

Loop inner calls should use mailing not self.

Task ID-2455433

closes odoo/odoo#65755

X-original-commit: d63734eb6e00c079ad9c0658674efb2321610173
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Thibault Delavallée
2021-02-09 07:55:23 +00:00
parent 5845bef12b
commit 1b8aa71e6b
+2 -2
View File
@@ -617,7 +617,7 @@ class MassMailing(models.Model):
composer_values = {
'author_id': author_id,
'attachment_ids': [(4, attachment.id) for attachment in mailing.attachment_ids],
'body': self._prepend_preview(self.body_html, self.preview),
'body': mailing._prepend_preview(mailing.body_html, mailing.preview),
'subject': mailing.subject,
'model': mailing.mailing_model_real,
'email_from': mailing.email_from,
@@ -633,7 +633,7 @@ class MassMailing(models.Model):
composer_values['reply_to'] = mailing.reply_to
composer = self.env['mail.compose.message'].with_context(active_ids=res_ids).create(composer_values)
extra_context = self._get_mass_mailing_context()
extra_context = mailing._get_mass_mailing_context()
composer = composer.with_context(active_ids=res_ids, **extra_context)
# auto-commit except in testing mode
auto_commit = not getattr(threading.currentThread(), 'testing', False)