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

Module: Resource

Entity: resource.calendar.attendance

Compute Method: _compute_day_period

Inputs Method Outputs
for attendance in self:
            if attendance.duration_hours > (0.75 * attendance.calendar_id.hours_per_day) or attendance.duration_based:
                attendance.day_period = 'full_day'
            elif attendance.hour_from and attendance.hour_to:
                if attendance.hour_from > 12 or (12 - attendance.hour_from <= attendance.hour_to - 12):
                    attendance.day_period = 'afternoon'
                else:
                    attendance.day_period = 'morning'
            else:
                attendance.day_period = 'morning'

Back to entity