[FIX] project: correctly set progress of task

When setting a task as done, the state is done and the progress written to 100%.
If this task is reopened, the progress was not resetted as the stage is changed
but not the state (still done).
Partially backport behaviour of 8.0 (8fbfc997) by using the fold attribute
instead of the state to reset the progress.
opw 597688
This commit is contained in:
Martin Trigaux 2015-03-31 14:12:14 +02:00
parent 23918ae97d
commit f7234f3cea
1 changed files with 1 additions and 1 deletions

View File

@ -691,7 +691,7 @@ class task(base_stage, osv.osv):
res[task.id]['progress'] = 0.0
if (task.remaining_hours + hours.get(task.id, 0.0)):
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2)
if task.state in ('done','cancelled'):
if task.stage_id and task.stage_id.fold:
res[task.id]['progress'] = 100.0
return res