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

Module: HR Org Chart

Entity: hr.employee

Compute Method: _compute_child_count

View 19.0
Inputs Method Outputs
+ employee_read_group = self._read_group(
+             [('parent_id', 'in', self.ids)],
+             ['parent_id'],
+             ['id:count'],
+         )
+ child_count_per_parent_id = dict(employee_read_group)
+ for employee in self:
+             employee.child_count = child_count_per_parent_id.get(employee._origin, 0)
  • child_count

Back to entity