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.calendar

Compute Method: _compute_owner_id

Inputs Method Outputs
  • id
owner_records = self.env['calendar.user'].search([
            ('access_role', '=', 'owner'),
            ('calendar_id', 'in', self.ids),
        ])
for calendar in self:
            calendar.owner_id = owner_records.filtered(lambda l: l.calendar_id.id == calendar.id).user_id.id

Back to entity