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_is_manager

View 20.0
Inputs Method Outputs
  • attendance_manager_id
  • attendance_manager_id.id
  • employee_id
  • employee_id.user_id
+ have_manager_right = self.env.user.has_group('hr_attendance.group_hr_attendance_user')
+ have_officer_right = self.env.user.has_group('hr_attendance.group_hr_attendance_officer')
+ have_own_right = self.env.user.has_group('hr_attendance.group_hr_attendance_own')
+ for attendance in self:
+             attendance.is_manager = have_manager_right or \
+                 (have_officer_right and attendance.attendance_manager_id.id == self.env.user.id)
+             attendance.is_own = have_own_right and attendance.employee_id.user_id == self.env.user
  • is_manager
  • is_own

Back to entity