[FIX] mass_mailing: respect mail_server_id for test emails

When sending a test email for a mass mailing, it was using the default
server, ignoring the one that could have been set on the mailing object.

This commit fixes this issue, so that the way the test emails are sent
is even closer to the real process.

closes odoo/odoo#55072

X-original-commit: 6af6e4714f2ccc703e9a3189b12a2317bd6af49c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
This commit is contained in:
Paul Morelle
2020-07-28 15:43:36 +00:00
parent fff793f7d7
commit 544e22f4f2
@@ -36,6 +36,7 @@ class TestMassMailing(models.TransientModel):
'mailing_id': mailing.id,
'attachment_ids': [(4, attachment.id) for attachment in mailing.attachment_ids],
'auto_delete': True,
'mail_server_id': mailing.mail_server_id.id,
}
mail = self.env['mail.mail'].sudo().create(mail_values)
mails_sudo |= mail