Commit 90e6bd71 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 ff824852
...@@ -107,7 +107,7 @@ class PresencePeriod(Movement, PeriodicityMixin): ...@@ -107,7 +107,7 @@ class PresencePeriod(Movement, PeriodicityMixin):
stop_date=from_date)) stop_date=from_date))
return result return result
def _getDatePeriodList(self): def _getDatePeriodDataList(self):
""" """
Get all periods between periodicity start date Get all periods between periodicity start date
and periodicity stop date and periodicity stop date
...@@ -159,8 +159,9 @@ class PresencePeriod(Movement, PeriodicityMixin): ...@@ -159,8 +159,9 @@ class PresencePeriod(Movement, PeriodicityMixin):
else: else:
# SQL method don't like iterator # SQL method don't like iterator
# yield (next_start_date, next_start_date+duration) # yield (next_start_date, next_start_date+duration)
result.append([next_start_date, result.append({'start_date': next_start_date,
addToDate(next_start_date, second=second_duration)]) 'stop_date': addToDate(next_start_date, second=second_duration),
'quantity': self.getQuantity()})
next_start_date = self.getNextPeriodicalDate(next_start_date) next_start_date = self.getNextPeriodicalDate(next_start_date)
return result 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