diff options
| author | Thibault Delavallée <tde@odoo.com> | 2021-04-19 11:48:17 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2021-04-19 14:09:00 +0000 |
| commit | 509d761921167a041bfe5dd403181d399c20dacc (patch) | |
| tree | be6777f957de0461773e48531e4417c54d9be721 | |
| parent | 7aceb76c277b8b18d0315b5acf3645ab20528380 (diff) | |
[FIX] mass_mailing: do not remove ignored traces from expected count
Partial backport of odoo/odoo@3e6bbedb64485772181e2ae53ef76308176821d0 . Purpose is to have expected being all
traces generated at beginning of mailing. Ignored should not be removed from
that expected count.
LINKS
Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780
| -rw-r--r-- | addons/mass_mailing/models/mailing.py | 2 | ||||
| -rw-r--r-- | addons/test_mail_full/tests/test_mass_mailing.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 1fecd2a87a6..06965f0e744 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -202,7 +202,7 @@ class MassMailing(models.Model): m.id """, (tuple(self.ids), )) for row in self.env.cr.dictfetchall(): - total = row['expected'] = (row['expected'] - row['ignored']) or 1 + total = (row['expected'] - row['ignored']) or 1 row['received_ratio'] = 100.0 * row['delivered'] / total row['opened_ratio'] = 100.0 * row['opened'] / total row['replied_ratio'] = 100.0 * row['replied'] / total diff --git a/addons/test_mail_full/tests/test_mass_mailing.py b/addons/test_mail_full/tests/test_mass_mailing.py index ff0f43b7f90..9693631ec8a 100644 --- a/addons/test_mail_full/tests/test_mass_mailing.py +++ b/addons/test_mail_full/tests/test_mass_mailing.py @@ -119,4 +119,4 @@ class TestMassMailing(TestMailFullCommon): check_mail=True,) # sent: 13, 2 bl, 2 opt-out, 3 invalid -> 6 remaining - self.assertMailingStatistics(mailing, expected=6, delivered=6, sent=6, ignored=7) + self.assertMailingStatistics(mailing, expected=13, delivered=6, sent=6, ignored=7) |
