Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Link Tracker

Entity: link.tracker

Compute Method: _compute_count

Inputs Method Outputs
  • id
clicks_data = self.env['link.tracker.click']._read_group(
            [('link_id', 'in', self.ids)],
            ['link_id'],
            ['__count'],
        )
mapped_data = {link.id: count for link, count in clicks_data}
for tracker in self:
            tracker.count = mapped_data.get(tracker.id, 0)

Back to entity