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_number_of_days

View 18.0 View 19.0
Inputs Method Outputs
  • type_request_unit
  • number_of_days_display
  • employee_id
  • date_from
  • number_of_hours_display
for allocation in self:
            allocation_unit = allocation.type_request_unit
            if allocation_unit != 'hour':
                allocation.number_of_days = allocation.number_of_days_display
-             elif allocation_unit == 'hour' and allocation.employee_id and allocation.employee_id._get_hours_per_day(allocation.date_from) > 0:
+             elif allocation_unit == 'hour' and allocation.employee_id:
                allocation.number_of_days = allocation.number_of_hours_display / allocation.employee_id._get_hours_per_day(allocation.date_from)
  • number_of_days

Back to entity