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

Module: Attendances

Entity: hr.attendance

Compute Method: _compute_overtime_status

Inputs Method Outputs
for attendance in self:
            if not attendance.linked_overtime_ids:
                attendance.overtime_status = False
            elif all(attendance.linked_overtime_ids.mapped(lambda ot: ot.status == 'approved')):
                attendance.overtime_status = 'approved'
            elif all(attendance.linked_overtime_ids.mapped(lambda ot: ot.status == 'refused')):
                attendance.overtime_status = 'refused'
            else:
                attendance.overtime_status = 'to_approve'

Back to entity