diff options
Diffstat (limited to 'addons/mass_mailing/models/mailing.py')
| -rw-r--r-- | addons/mass_mailing/models/mailing.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 172302f21eb..38814270ae1 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -72,7 +72,6 @@ class MassMailing(models.Model): 'utm.medium', string='Medium', compute='_compute_medium_id', readonly=False, store=True, help="UTM Medium: delivery method (email, sms, ...)") - clicks_ratio = fields.Integer(compute="_compute_clicks_ratio", string="Number of Clicks") state = fields.Selection([('draft', 'Draft'), ('in_queue', 'In Queue'), ('sending', 'Sending'), ('done', 'Sent')], string='Status', required=True, tracking=True, copy=False, default='draft', group_expand='_group_expand_states') color = fields.Integer(string='Color Index') @@ -126,6 +125,7 @@ class MassMailing(models.Model): opened_ratio = fields.Integer(compute="_compute_statistics", string='Opened Ratio') replied_ratio = fields.Integer(compute="_compute_statistics", string='Replied Ratio') bounced_ratio = fields.Integer(compute="_compute_statistics", string='Bounced Ratio') + clicks_ratio = fields.Integer(compute="_compute_clicks_ratio", string="Number of Clicks") next_departure = fields.Datetime(compute="_compute_next_departure", string='Scheduled date') def _compute_total(self): @@ -326,6 +326,17 @@ class MassMailing(models.Model): action['context'][filter_key] = True return action + def action_view_clicked(self): + model_name = self.env['ir.model']._get('link.tracker').display_name + return { + 'name': model_name, + 'type': 'ir.actions.act_window', + 'view_mode': 'tree', + 'res_model': 'link.tracker', + 'domain': [('mass_mailing_id.id', '=', self.id)], + 'context': dict(self._context, create=False) + } + def action_view_opened(self): return self._action_view_documents_filtered('opened') @@ -335,14 +346,11 @@ class MassMailing(models.Model): def action_view_bounced(self): return self._action_view_documents_filtered('bounced') - def action_view_clicked(self): - return self._action_view_documents_filtered('clicked') - def action_view_delivered(self): return self._action_view_documents_filtered('delivered') def _action_view_documents_filtered(self, view_filter): - if view_filter in ('opened', 'replied', 'bounced', 'clicked'): + if view_filter in ('opened', 'replied', 'bounced'): 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) |
