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

Inputs Method Outputs
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

Back to entity