FIX sale_planner Transit time calculations.

Tested in these scenarios.
 - won't ship until next week and would be delivered in the week
 - won't ship until next week and delivered the following week
 - will ship this week and deliver this week
 - will ship this week and deliver next week
This commit is contained in:
Jared Kipe
2019-11-19 11:21:41 -08:00
parent 8478695590
commit 04e90c4f82

View File

@@ -72,12 +72,9 @@ class DeliveryCarrier(models.Model):
return self._calculate_transit_days_naive(date_planned, date_delivered)
if current_date_planned == date_planned:
date_planned += timedelta(days=1)
transit_days += 1
else:
date_planned = current_date_planned
transit_days += 1
if transit_days > 1:
transit_days -= 1
return transit_days