summaryrefslogtreecommitdiff
path: root/addons/link_tracker/models/utm.py
diff options
context:
space:
mode:
authorqmo-odoo <qmo@odoo.com>2019-09-06 06:51:56 +0000
committerThibault Delavallée <tde@odoo.com>2019-09-20 14:21:25 +0000
commitaf601da9bedf035d3248ac2d284ef19aa6c08bde (patch)
tree34d1b8b7eb505899890e846aa829305e895c7f73 /addons/link_tracker/models/utm.py
parentad98c634006c8943a6c1647c11d08e3437f725a7 (diff)
[IMP] utm, mass_mailing: clean utm.campaign model, form view and stat buttons
This commit cleans up the utm.campaign form view: * Don't display mailing related things if no mailings on the campaign or if the campaigns were not activated in mass_mailing settings; * Stat button for the mass mailings was wrong, it was displaying the number of mails instead of the number of mailings; * Remove unused global click ratio field all other fields/methods related to its computation; * Remove ab testing cta on campaign form; * Add groups on mailing related fields to avoid access errors; LINKS Task ID 2074813 (FP request UTM refactor) PR: #37185
Diffstat (limited to 'addons/link_tracker/models/utm.py')
-rw-r--r--addons/link_tracker/models/utm.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/addons/link_tracker/models/utm.py b/addons/link_tracker/models/utm.py
index 6d356ad7d5a..ebb343472e7 100644
--- a/addons/link_tracker/models/utm.py
+++ b/addons/link_tracker/models/utm.py
@@ -8,9 +8,6 @@ class UtmCampaign(models.Model):
_inherit = ['utm.campaign']
_description = 'UTM Campaign'
- items_total = fields.Integer(string="Number of items that are part of the campaign", compute="_compute_items_total")
- clicked_total = fields.Integer(string="Number of items that are part of the campaign who generated a click", compute="_compute_items_total")
- clicks_ratio = fields.Integer(string="Global Clicks Ratio for the campaign", compute="_compute_clicks_ratio")
click_count = fields.Integer(string="Number of clicks generated by the campaign", compute="_compute_clicks_count")
def _compute_clicks_count(self):
@@ -22,13 +19,3 @@ class UtmCampaign(models.Model):
for campaign in self:
campaign.click_count = mapped_data.get(campaign.id, 0)
-
- def _compute_items_total(self):
- """Empty method that will be implemented by inheriting classes"""
- self.clicked_total = 0
- self.items_total = 0
-
- @api.depends('items_total', 'clicked_total')
- def _compute_clicks_ratio(self):
- for campaign in self:
- campaign.clicks_ratio = campaign.clicked_total / campaign.items_total * 100 if campaign.items_total > 0 else 0