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

Module: Resource booking

Entity: res.partner

Compute Method: _compute_resource_booking_count

Inputs Method Outputs
booking_count_by_partner = dict(
            self.env["resource.booking"]._read_group(
                [("partner_ids", "in", self.ids)], ["partner_ids"], ["__count"]
            )
        )
for p in self:
            p.resource_booking_count = booking_count_by_partner.get(p, 0)

Back to entity