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

Module: Remote Work

Entity: hr.employee.base

Compute Method: _compute_exceptional_location_id

Inputs Method Outputs
  • id
today = fields.Date.today()
current_employee_locations = self.env['hr.employee.location'].search([
            ('employee_id', 'in', self.ids),
            ('date', '=', today),
        ])
employee_work_locations = {l.employee_id.id: l.work_location_id for l in current_employee_locations}
for employee in self:
            employee.exceptional_location_id = employee_work_locations.get(employee.id, False)

Back to entity