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

Module: Resource

Entity: resource.calendar

Compute Method: _compute_work_resources_count

Inputs Method Outputs
resources_per_calendar = dict(self.env['resource.resource']._read_group(
            domain=[('calendar_id', 'in', self.ids)],
            groupby=['calendar_id'],
            aggregates=['__count']))
for calendar in self:
            calendar.work_resources_count = resources_per_calendar.get(calendar, 0)

Back to entity