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

Compute Method: _compute_days_per_week

View 20.0
Inputs Method Outputs
  • calendar_type
  • attendance_ids
+ for calendar in self:
+             # variable/undefined calendars don't have a reliable attendance pattern to derive
+             # this from (undefined calendars have none at all); the user sets it directly instead.
+             if calendar.calendar_type != 'fixed':
+                 continue
+             attendances = calendar.attendance_ids.filtered(lambda a: a._is_work_period())
+             calendar.days_per_week = len(set(attendances.mapped('dayofweek')))
  • days_per_week

Back to entity