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

Module: Employees

Entity: res.users

Compute Method: _compute_company_employee

Inputs Method Outputs
employee_per_user = {
            employee.user_id: employee
            for employee in self.env['hr.employee'].search([('user_id', 'in', self.ids), ('company_id', '=', self.env.company.id)])
        }
for user in self:
            user.employee_id = employee_per_user.get(user)

Back to entity