Force computed duration to be a timedelta in any cases

issue4722
review14241002
This commit is contained in:
Cédric Krier
2015-05-06 18:24:00 +02:00
parent c0a45871c5
commit a7e44cd7b4
+3 -2
View File
@@ -110,8 +110,9 @@ class Work:
leafs.add(work.id)
total_allocation = 0
if not work.allocations or not work.effort_duration:
durations[work.id] = work.effort_duration
if not work.allocations:
durations[work.id] = (work.effort_duration
or datetime.timedelta())
continue
for allocation in work.allocations:
total_allocation += allocation.percentage