agenda: availabilities in schedules are service agnostic

Closes #5587
This commit is contained in:
Serghei Mihai 2014-09-26 15:19:57 +02:00
parent a943486280
commit c7a7ddf674
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ def get_daily_appointments(date, worker, service, time_tables, events, holidays)
service_time_tables = [tt for tt in time_tables if service in tt.services.all()]
timetables_set = IntervalSet((t.to_interval(date) for t in service_time_tables))
holidays_set = IntervalSet((h.to_interval(date) for h in holidays))
busy_occurrences_set = IntervalSet((o.to_interval() for o in events if not o.is_event_absence() and service in o.services.all()))
busy_occurrences_set = IntervalSet((o.to_interval() for o in events if not o.is_event_absence()))
for free_time in timetables_set - (busy_occurrences_set+holidays_set):
if free_time:
delta = free_time.upper_bound - free_time.lower_bound