From 60e4e9912a0ceb039019186736f28fe3be17ede6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Mottet=20=28oms=29?= Date: Wed, 25 Mar 2020 08:22:33 +0000 Subject: [PATCH] [IMP] mass_mailing: improve displayed info text and KPIs PURPOSE Clarify the use case in which a specified email address is set as replies may not be traceable. Make the %Click KPIs visible for Emails as well. Allow users to report on the links that have (or not) been clicked from their mailing. SPECIFICATIONS Add an info text for the "specified email address" option in the "reply to" field. If target model does not accept incoming emails warn the user it is likely to fail. Number of emails/sms sent is now display as clickable text instead of stat button and clicked stat button is now also visible in mass_mailing. Task ID: 2202495 PR #48339 --- .../mass_mailing/data/mass_mailing_demo.xml | 13 +++++-- addons/mass_mailing/models/mailing.py | 8 ++--- .../views/mailing_mailing_views.xml | 35 ++++++++++++++----- .../views/mailing_mailing_views.xml | 2 +- .../views/mailing_mailing_views.xml | 2 +- .../views/mailing_mailing_views.xml | 27 ++++---------- 6 files changed, 49 insertions(+), 38 deletions(-) diff --git a/addons/mass_mailing/data/mass_mailing_demo.xml b/addons/mass_mailing/data/mass_mailing_demo.xml index deb37b23398..bb4a942bbff 100644 --- a/addons/mass_mailing/data/mass_mailing_demo.xml +++ b/addons/mass_mailing/data/mass_mailing_demo.xml @@ -215,7 +215,7 @@ - 1111004@odoo.com + 1111005@odoo.com res.partner julie.richards84@example.com @@ -224,13 +224,22 @@ - 1111004@odoo.com + 1111006@odoo.com res.partner travis.mendoza24@example.com + + + 1111007@odoo.com + res.partner + + travis.mendoza24@example.com + + + diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index e644f4b0d7c..172302f21eb 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -315,6 +315,9 @@ class MassMailing(models.Model): def action_view_traces_failed(self): return self._action_view_traces_filtered('failed') + def action_view_traces_sent(self): + return self._action_view_traces_filtered('sent') + def _action_view_traces_filtered(self, view_filter): action = self.env.ref('mass_mailing.mailing_trace_action').read()[0] action['name'] = _('%s Traces') % (self.name) @@ -323,9 +326,6 @@ class MassMailing(models.Model): action['context'][filter_key] = True return action - def action_view_sent(self): - return self._action_view_documents_filtered('sent') - def action_view_opened(self): return self._action_view_documents_filtered('opened') @@ -342,7 +342,7 @@ class MassMailing(models.Model): return self._action_view_documents_filtered('delivered') def _action_view_documents_filtered(self, view_filter): - if view_filter in ('sent', 'opened', 'replied', 'bounced', 'clicked'): + if view_filter in ('opened', 'replied', 'bounced', 'clicked'): opened_stats = self.mailing_trace_ids.filtered(lambda stat: stat[view_filter]) elif view_filter == ('delivered'): opened_stats = self.mailing_trace_ids.filtered(lambda stat: stat.sent and not stat.bounced) diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml index 1469bb1f6ba..f4ef91a8c31 100644 --- a/addons/mass_mailing/views/mailing_mailing_views.xml +++ b/addons/mass_mailing/views/mailing_mailing_views.xml @@ -57,7 +57,7 @@ -