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

Module: EDI endpoint

Entity: edi.backend

Compute Method: _compute_endpoints_count

Inputs Method Outputs
  • id
data = self.env["edi.endpoint"]._read_group(
            domain=Domain("backend_id", "in", self.ids) & Domain("active", "=", True),
            groupby=["backend_id"],
            aggregates=["__count"],
        )
by_backend_id = {backend.id: count for backend, count in data}
for record in self:
            record.endpoints_count = by_backend_id.get(record.id, 0)

Back to entity