diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py
index 3c7480abfb2..3d082070280 100644
--- a/addons/mass_mailing/models/mass_mailing.py
+++ b/addons/mass_mailing/models/mass_mailing.py
@@ -414,6 +414,7 @@ class MassMailing(models.Model):
sent = fields.Integer(compute="_compute_statistics")
delivered = fields.Integer(compute="_compute_statistics")
opened = fields.Integer(compute="_compute_statistics")
+ clicked = fields.Integer(compute="_compute_statistics")
replied = fields.Integer(compute="_compute_statistics")
bounced = fields.Integer(compute="_compute_statistics")
failed = fields.Integer(compute="_compute_statistics")
@@ -457,6 +458,7 @@ class MassMailing(models.Model):
COUNT(CASE WHEN s.scheduled is not null AND s.sent is null AND s.exception is not null THEN 1 ELSE null END) AS failed,
COUNT(CASE WHEN s.sent is not null AND s.bounced is null THEN 1 ELSE null END) AS delivered,
COUNT(CASE WHEN s.opened is not null THEN 1 ELSE null END) AS opened,
+ COUNT(CASE WHEN s.clicked is not null THEN 1 ELSE null END) AS clicked,
COUNT(CASE WHEN s.replied is not null THEN 1 ELSE null END) AS replied,
COUNT(CASE WHEN s.bounced is not null THEN 1 ELSE null END) AS bounced,
COUNT(CASE WHEN s.exception is not null THEN 1 ELSE null END) AS failed
@@ -474,6 +476,7 @@ class MassMailing(models.Model):
total = row.pop('total') or 1
row['received_ratio'] = 100.0 * row['delivered'] / total
row['opened_ratio'] = 100.0 * row['opened'] / total
+ row['clicks_ratio'] = 100.0 * row['clicked'] / total
row['replied_ratio'] = 100.0 * row['replied'] / total
row['bounced_ratio'] = 100.0 * row['bounced'] / total
self.browse(row.pop('mailing_id')).update(row)
diff --git a/addons/mass_mailing/models/mass_mailing_report.py b/addons/mass_mailing/models/mass_mailing_report.py
index 0747fab18fb..13f8c873d6e 100644
--- a/addons/mass_mailing/models/mass_mailing_report.py
+++ b/addons/mass_mailing/models/mass_mailing_report.py
@@ -17,6 +17,7 @@ class MassMailingReport(models.Model):
opened = fields.Integer(readonly=True)
bounced = fields.Integer(readonly=True)
replied = fields.Integer(readonly=True)
+ clicked = fields.Integer(readonly=True)
state = fields.Selection([('draft', 'Draft'), ('test', 'Tested'), ('done', 'Sent')],
string='Status', readonly=True)
email_from = fields.Char('From', readonly=True)
@@ -39,6 +40,7 @@ class MassMailingReport(models.Model):
(count(ms.sent) - count(ms.bounced)) as delivered,
count(ms.opened) as opened,
count(ms.replied) as replied,
+ count(ms.clicked) as clicked,
mm.state,
mm.email_from
FROM
diff --git a/addons/mass_mailing/views/mass_mailing_report_views.xml b/addons/mass_mailing/views/mass_mailing_report_views.xml
index fea496263a3..cdf9bf7d936 100644
--- a/addons/mass_mailing/views/mass_mailing_report_views.xml
+++ b/addons/mass_mailing/views/mass_mailing_report_views.xml
@@ -11,6 +11,7 @@
+