Browse Source

[FIX] b_shift : future_alert_date

Fixup for [FIX] b_shift : next_countdown computation
pull/124/head
Elouan Le Bars 4 years ago
parent
commit
cc4cca247d
  1. 7
      beesdoo_shift/models/cooperative_status.py

7
beesdoo_shift/models/cooperative_status.py

@ -138,9 +138,9 @@ class CooperativeStatus(models.Model):
counter = rec.sr
# Simulate the countdown
while counter > 0:
date = add_days_delta(date, 1)
date = self._next_countdown_date(rec.irregular_start_date,
date)
date = self._next_countdown_date(
rec.irregular_start_date, date
)
# Check holidays
if (rec.holiday_start_time and rec.holiday_end_time
and date >= rec.holiday_start_time
@ -154,6 +154,7 @@ class CooperativeStatus(models.Model):
continue
else:
counter -= 1
date = add_days_delta(date, 1)
rec.future_alert_date = self._next_countdown_date(
rec.irregular_start_date, date
)

Loading…
Cancel
Save