Use empty timedelta for computing duration when effort is empty

issue6589
review41401002
This commit is contained in:
Sergi Almacellas Abellana
2017-06-26 09:40:31 +02:00
parent 320b1dee90
commit aa77c3f5ec
+3 -3
View File
@@ -110,14 +110,14 @@ class Work:
leafs.add(work.id)
total_allocation = 0
effort = work.effort_duration or datetime.timedelta()
if not work.allocations:
durations[work.id] = (work.effort_duration
or datetime.timedelta())
durations[work.id] = effort
continue
for allocation in work.allocations:
total_allocation += allocation.percentage
durations[work.id] = datetime.timedelta(
seconds=work.effort_duration.total_seconds()
seconds=effort.total_seconds()
/ (total_allocation / 100.0))
while leafs: