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

Module: Calendar

Entity: calendar.event

Compute Method: _compute_attendees_count

Inputs Method Outputs
for event in self:
            count_event = {}
            for attendee in event.attendee_ids:
                count_event[attendee.state] = count_event.get(attendee.state, 0) + 1

            accepted_count = count_event.get('accepted', 0)
            declined_count = count_event.get('declined', 0)
            tentative_count = count_event.get('tentative', 0)
            attendees_count = len(event.partner_ids)
            event.update({
                'accepted_count': accepted_count,
                'declined_count': declined_count,
                'tentative_count': tentative_count,
                'attendees_count': attendees_count,
                'awaiting_count': attendees_count - accepted_count - declined_count - tentative_count
            })

Back to entity