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

Module: Event CRM

Entity: event.event

Compute Method: _compute_lead_count

Inputs Method Outputs
  • id
lead_data = self.env['crm.lead']._read_group(
            [('event_id', 'in', self.ids)],
            ['event_id'], ['__count'],
        )
mapped_data = {event.id: count for event, count in lead_data}
for event in self:
            event.lead_count = mapped_data.get(event.id, 0)

Back to entity