From ebba721130b9887f67d4fefc9ec4855d12634cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 9 Jan 2019 16:28:58 +0000 Subject: [PATCH] [FIX] mass_mailing: fix statistic state computation Replied / Bounced / Opened states should be computed prior to Sent state. Indeed Sent is the default state once the email is sent. Then replied, bounced and opened are states that happen after sending the email. It is therefore necessary to re-order the state computation to correctly compute the statistic state. Related to task ID 1924711 Linked to PR #32496 Signed-off-by: Thibault Delavallee (tde) --- addons/mass_mailing/models/mass_mailing_stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/models/mass_mailing_stats.py b/addons/mass_mailing/models/mass_mailing_stats.py index 662b6adbaaf..f0d8a763438 100644 --- a/addons/mass_mailing/models/mass_mailing_stats.py +++ b/addons/mass_mailing/models/mass_mailing_stats.py @@ -66,14 +66,14 @@ class MailMailStats(models.Model): stat.state = 'ignored' elif stat.exception: stat.state = 'exception' - elif stat.sent: - stat.state = 'sent' elif stat.opened or stat.clicked: stat.state = 'opened' elif stat.replied: stat.state = 'replied' elif stat.bounced: stat.state = 'bounced' + elif stat.sent: + stat.state = 'sent' else: stat.state = 'outgoing'