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: hr.employee

Compute Method: _compute_version_id

View 19.0
Inputs Method Outputs
  • current_version_id
+ context_version_id = self.env.context.get('version_id', False)
+ context_version = self.env['hr.version'].browse(context_version_id).exists() if context_version_id else self.env['hr.version']
+ for employee in self:
+             if context_version.employee_id == self:
+                 version = context_version
+             else:
+                 version = employee.current_version_id
+             employee.version_id = version
  • version_id

Back to entity