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

Module: Employee Contracts

Entity: hr.employee

Compute Method: _compute_contracts_count

View 17.0
Inputs Method Outputs
- contract_histories = self.env['hr.contract.history'].sudo().search([('employee_id', 'in', self.ids)])
- for employee in self:
-             contract_history = contract_histories.filtered(lambda ch: ch.employee_id == employee)
-             employee.contracts_count = contract_history.contract_count
  • contracts_count

Back to entity