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

Module: HR Attendance Auto Close

Entity: hr.attendance

Compute Method: _compute_open_worked_hours

Inputs Method Outputs
  • check_out
  • check_in
for item in self:
            item_from = item.check_out if item.check_out else datetime.now()
            delta = item_from - item.check_in
            item.open_worked_hours = delta.total_seconds() / 3600.0

Back to entity