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

Module: Helpdesk Sale Order

Entity: helpdesk.ticket

Compute Method: _compute_so_count

Inputs Method Outputs
  • id
group_data = self.env["sale.order"]._read_group(
            domain=[("ticket_ids", "in", self.ids)],
            groupby=["ticket_ids"],
            aggregates=["__count"],
        )
mapped_data = {ticket.id: count for (ticket, count) in group_data}
for ticket in self:
            ticket.so_count = mapped_data.get(ticket.id, 0)

Back to entity