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

Module: Partner Auth

Entity: auth.directory

Compute Method: _compute_count_partner

Inputs Method Outputs
  • id
data = self.env["auth.partner"]._read_group(
            [
                ("directory_id", "in", self.ids),
            ],
            ["directory_id"],
            aggregates=["__count"],
        )
mapped_data = {auth_partner.id: count for auth_partner, count in data}
for record in self:
            record.count_partner = mapped_data.get(record.id, 0)

Back to entity