Browse Source

[FIX] b_shift : future_alert_date

Fixup for [FIX] b_shift : next_countdown computation
pull/124/head
Elouan Le Bars 5 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 counter = rec.sr
# Simulate the countdown # Simulate the countdown
while counter > 0: 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 # Check holidays
if (rec.holiday_start_time and rec.holiday_end_time if (rec.holiday_start_time and rec.holiday_end_time
and date >= rec.holiday_start_time and date >= rec.holiday_start_time
@ -154,6 +154,7 @@ class CooperativeStatus(models.Model):
continue continue
else: else:
counter -= 1 counter -= 1
date = add_days_delta(date, 1)
rec.future_alert_date = self._next_countdown_date( rec.future_alert_date = self._next_countdown_date(
rec.irregular_start_date, date rec.irregular_start_date, date
) )

Loading…
Cancel
Save