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_recurrency_until

View 20.0
Inputs Method Outputs
  • recurrency
  • date
  • recurrency_end_type
  • recurrency_until
  • recurrency_type
  • recurrency_interval
  • recurrency_count
+ for attendance in self:
+             if not attendance.recurrency:
+                 attendance.recurrency_until = attendance.date
+                 continue
+             match attendance.recurrency_end_type:
+                 case 'date' if attendance.recurrency_until == date.max:
+                     attendance.recurrency_until = date.today()
+                 case 'times' if attendance.date and attendance.recurrency_type and attendance.recurrency_interval and attendance.recurrency_count:
+                     attendance.recurrency_until = attendance.date + timedelta(**{attendance.recurrency_type: attendance.recurrency_interval * (attendance.recurrency_count - 1)})
+                 case 'forever':
+                     attendance.recurrency_until = date.max
  • recurrency_until

Back to entity