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_duration_display

View 19.0 View 20.0
Inputs Method Outputs
  • type_request_unit
  • number_of_hours_display
  • number_of_days_display
  • number_of_hours
for allocation in self:
            allocation.duration_display = '%g %s' % (
-                 (float_round(allocation.number_of_hours_display, precision_digits=2)
+                 (float_round(allocation.number_of_hours, precision_digits=2)
                if allocation.type_request_unit == 'hour'
                else float_round(allocation.number_of_days_display, precision_digits=2)),
                _('hours') if allocation.type_request_unit == 'hour' else _('days'))
  • duration_display

Back to entity