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

Module: Employees Shifts

Entity: hr.shift.planning.line

Compute Method: _compute_duration

View 17.0
Inputs Method Outputs
  • start_time
  • end_time
- for line in self:
-             if line.start_time and line.end_time:
-                 delta = line.end_time - line.start_time
-                 line.duration_hours = delta.total_seconds() / 3600.0
-                 line.duration_days = 1
-             else:
-                 line.duration_hours = 0.0
-                 line.duration_days = 0.0
  • duration_hours
  • duration_days

Back to entity