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(
            [("backend_id", "in", self.ids), ("active", "=", True)],
            ["backend_id"],
            ["backend_id"],
        )
by_backend_id = {x["backend_id"][0]: x["backend_id_count"] for x in data}
for record in self:
            record.endpoints_count = by_backend_id.get(record.id)

Back to entity