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 Holidays

Entity: res.users

Compute Method: _compute_request_overtime

View 17.0
Inputs Method Outputs
  • total_overtime
- is_holiday_user = self.env.user.has_group('hr_holidays.group_hr_holidays_user')
- time_off_types = self.env['hr.leave.type'].search_count([
-             ('requires_allocation', '=', 'yes'),
-             ('employee_requests', '=', 'yes'),
-             ('overtime_deductible', '=', True)
-         ])
- for user in self:
-             if user.total_overtime >= 1:
-                 if is_holiday_user:
-                     user.request_overtime = True
-                 else:
-                     user.request_overtime = time_off_types
-             else:
-                 user.request_overtime = False
  • request_overtime

Back to entity