From f403a3f1798fa9bcda877e57f59a3a1ee86ab40a Mon Sep 17 00:00:00 2001 From: "Audric Onockx (auon)" Date: Wed, 13 Jul 2022 11:21:19 +0000 Subject: [PATCH] [IMP] hr_timesheet: allow progress over max Allow tasks' progress to go beyond go beyond 100%. In tasks' list views, display the progress bar in red if the progress > 100%. task-2909337 closes odoo/odoo#96104 Related: odoo/enterprise#29565 Signed-off-by: Xavier Bol (xbo) --- addons/hr_timesheet/models/project_task.py | 5 +---- addons/hr_timesheet/views/project_task_sharing_views.xml | 2 +- addons/hr_timesheet/views/project_task_views.xml | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/hr_timesheet/models/project_task.py b/addons/hr_timesheet/models/project_task.py index dee648f593b..15e2a5e229f 100644 --- a/addons/hr_timesheet/models/project_task.py +++ b/addons/hr_timesheet/models/project_task.py @@ -78,10 +78,7 @@ class Task(models.Model): if (task.planned_hours > 0.0): task_total_hours = task.effective_hours + task.subtask_effective_hours task.overtime = max(task_total_hours - task.planned_hours, 0) - if task_total_hours > task.planned_hours: - task.progress = 100 - else: - task.progress = round(100.0 * task_total_hours / task.planned_hours, 2) + task.progress = round(100.0 * task_total_hours / task.planned_hours, 2) else: task.progress = 0.0 task.overtime = 0 diff --git a/addons/hr_timesheet/views/project_task_sharing_views.xml b/addons/hr_timesheet/views/project_task_sharing_views.xml index 34ff3077ab7..2b590d785fd 100644 --- a/addons/hr_timesheet/views/project_task_sharing_views.xml +++ b/addons/hr_timesheet/views/project_task_sharing_views.xml @@ -12,7 +12,7 @@ - + diff --git a/addons/hr_timesheet/views/project_task_views.xml b/addons/hr_timesheet/views/project_task_views.xml index 694e08a97b2..2a58154e6f4 100644 --- a/addons/hr_timesheet/views/project_task_views.xml +++ b/addons/hr_timesheet/views/project_task_views.xml @@ -12,7 +12,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -168,7 +168,7 @@ - +