[IMP] link_tracker: allow multiple clicks

This PR removes filter on ip so that each click should count as one.
previously multiple clicks from the same device only counted as one,
but now because of the ip removal, they are being counted as many
times as you go to the link.

task-3328661

closes odoo/odoo#132812

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
dane@odoo.com
2023-10-13 19:14:53 +00:00
parent dc7328ff0f
commit 6644cb7e3a
2 changed files with 0 additions and 14 deletions
@@ -293,11 +293,6 @@ class LinkTrackerClick(models.Model):
if not tracker_code:
return None
ip = route_values.get('ip', False)
existing = self.search_count(['&', ('link_id', '=', tracker_code.link_id.id), ('ip', '=', ip)])
if existing:
return None
route_values['link_id'] = tracker_code.link_id.id
click_values = self._prepare_click_values_from_route(**route_values)
@@ -34,15 +34,6 @@ class TestLinkTracker(common.TestMassMailCommon):
self.assertEqual(click.country_id, self.env.ref('base.be'))
self.assertEqual(self.link.count, 2)
# click from same IP (even another country) does not create a new entry
click = self.env['link.tracker.click'].sudo().add_click(
code,
ip='100.00.00.01',
country_code='FRA'
)
self.assertEqual(click, None)
self.assertEqual(self.link.count, 2)
@users('user_marketing')
def test_add_link_mail_stat(self):
record = self.env['mailing.test.blacklist'].create({})