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.overtime.line

Compute Method: _compute_is_manager

Inputs Method Outputs
has_manager_right = self.env.user.has_group('hr_attendance.group_hr_attendance_manager')
has_officer_right = self.env.user.has_group('hr_attendance.group_hr_attendance_officer')
for overtime in self:
            overtime.is_manager = (
                has_manager_right or
                (
                    has_officer_right
                    and overtime.employee_id.attendance_manager_id == self.env.user
                )
            )

Back to entity