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

Module: Time Off

Entity: hr.leave.allocation

Compute Method: _compute_department_id

View 17.0 View 20.0
Inputs Method Outputs
  • holiday_type
  • employee_id
  • employee_id.department_id
  • department_id
for allocation in self:
-             if allocation.holiday_type == 'employee':
-                 allocation.department_id = allocation.employee_id.department_id
-             elif allocation.holiday_type == 'department':
-                 if not allocation.department_id:
-                     allocation.department_id = self.env.user.employee_id.department_id
-             elif allocation.holiday_type == 'category':
-                 allocation.department_id = False
+             allocation.department_id = allocation.employee_id.department_id
  • department_id

Back to entity