Skip to content
Snippets Groups Projects
Commit c0baca3f authored by Gurupreet Singh's avatar Gurupreet Singh
Browse files

[FIX] hr_timesheet: Fix progress bar value in project task view


Description of the issue/feature this PR addresses:
In the project task view, add initially planned hours 0.05 and assigned a
complete value to the the task then the progress bar shows the wrong value

Current behavior before PR:
when adding the  00:05 planned hours and assigning the complete duration the
The progress bar value is not right

Desired behavior after PR is merged:
progress bar value should be right

task-3280609

closes odoo/odoo#119020

Signed-off-by: default avatarXavier Bol (xbo) <xbo@odoo.com>
parent 6d4b02ac
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from lxml import etree
from odoo.tools.float_utils import float_compare
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError, RedirectWarning
......@@ -143,7 +143,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:
if float_compare(task_total_hours, task.planned_hours, precision_digits=2) >= 0:
task.progress = 100
else:
task.progress = round(100.0 * task_total_hours / task.planned_hours, 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment