From f7234f3cead4326d9c52274ff892dc93e29603ff Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 31 Mar 2015 14:12:14 +0200 Subject: [PATCH] [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 --- addons/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index 45fbd3c4a94..debeefa9f1f 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -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