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_hours_display

View 17.0
Inputs Method Outputs
  • holiday_status_id
  • holiday_status_id.company_id
  • holiday_status_id.company_id.resource_calendar_id
  • holiday_type
  • employee_id
  • number_of_days
- for allocation in self:
-             allocation_calendar = allocation.holiday_status_id.company_id.resource_calendar_id
-             if allocation.holiday_type == 'employee' and allocation.employee_id:
-                 allocation_calendar = allocation.employee_id.sudo().resource_calendar_id
- 
-             allocation.number_of_hours_display = allocation.number_of_days * (allocation_calendar.hours_per_day or HOURS_PER_DAY)
  • number_of_hours_display

Back to entity