Commit 24c836a7 authored by Sebastien Robin's avatar Sebastien Robin

ERP5/PresencePeriod : rename _getDatePeriodList to _getDatePeriodDataList

Not only returns start and stop dates, but also quantity defined
on presence periods. This make it possible to set 3 hours availability
in a time range of 10 hours.
parent a79219bb
......@@ -107,7 +107,7 @@ class PresencePeriod(Movement, PeriodicityMixin):
stop_date=from_date))
return result
def _getDatePeriodList(self):
def _getDatePeriodDataList(self):
"""
Get all periods between periodicity start date
and periodicity stop date
......@@ -159,8 +159,9 @@ class PresencePeriod(Movement, PeriodicityMixin):
else:
# SQL method don't like iterator
# yield (next_start_date, next_start_date+duration)
result.append([next_start_date,
addToDate(next_start_date, second=second_duration)])
result.append({'start_date': next_start_date,
'stop_date': addToDate(next_start_date, second=second_duration),
'quantity': self.getQuantity()})
next_start_date = self.getNextPeriodicalDate(next_start_date)
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment