diff --git a/work.py b/work.py index f9ca0b91a6..e972c18bc9 100644 --- a/work.py +++ b/work.py @@ -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: