summaryrefslogtreecommitdiff
path: root/addons/mail/wizard
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2021-05-21 08:46:20 +0000
committerNicolas Lempereur <nle@odoo.com>2021-05-26 11:23:28 +0000
commit965c67cb16d2a4ac10d35a01da3af311867a47e6 (patch)
treef75693ce6312c733ee78bd2867d912348812178c /addons/mail/wizard
parentd53d8bdf789e8f79ea4d531d944686abb59d6a26 (diff)
[FIX] mail,test_mass_mailing: unblacklist with mass mailing
The optimization 2ccf0bd0dc does not take into account that to "unblacklist" a user, you have the archive the mail.blacklist record so only mail.blacklist active records need to be taken into account. Added test without the fix fails with: AssertionError: False is not true : MailTrace: email test.record.02@test.example.com (recipient res.partner(), state: sent, record: mailing.test.blacklist(166,)): found 0 records (1 expected) opw-2536304 closes odoo/odoo#71239 X-original-commit: 8ffd82249728b79959cfa61490730991a2b339d6 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/mail/wizard')
-rw-r--r--addons/mail/wizard/mail_compose_message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index 517a797fc80..3384b32f94e 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -282,7 +282,7 @@ class MailComposer(models.TransientModel):
blacklisted_rec_ids = set()
if mass_mail_mode and issubclass(type(self.env[self.model]), self.pool['mail.thread.blacklist']):
self.env['mail.blacklist'].flush(['email'])
- self._cr.execute("SELECT email FROM mail_blacklist")
+ self._cr.execute("SELECT email FROM mail_blacklist WHERE active=true")
blacklist = {x[0] for x in self._cr.fetchall()}
if blacklist:
targets = self.env[self.model].browse(res_ids).read(['email_normalized'])