From a580dcaf484efb6a0c21d2fbae1e091a304a88f7 Mon Sep 17 00:00:00 2001 From: "Thomas Lefebvre (thle)" Date: Fri, 28 Oct 2022 08:26:39 +0000 Subject: [PATCH] [FIX] sale_project: round milestone percentage Steps to reproduce: - go to Project app; - go to the 'Project Updates' view of a project. (project must have task with milestone which has a quantity delivered when the goal is reached) Issue: For some quantity percentages, the display of the number of decimals is not correct. Example: 55, 58, 57, 56, etc. (but not 59, 54, etc.) Solution: Use the possibilities of the QWEB to perform a rounding. Remark: Widget percentage doesn't work in this case (not a field tag). `t-options='{"widget": "float", "precision": 2}'` also not working. `round()` method doesn't work too. The method toFixed(n) rounds the number to n digits after the point and returns a string representation of the result. (https://javascript.info/number) opw-3041813 closes odoo/odoo#105056 X-original-commit: fb3052787adf07d0db8e24e7977d0fd88518d0d7 Signed-off-by: Adrien Widart Signed-off-by: Lefebvre Thomas (thle) --- .../project_right_side_panel/components/project_milestone.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_project/static/src/components/project_right_side_panel/components/project_milestone.xml b/addons/sale_project/static/src/components/project_right_side_panel/components/project_milestone.xml index 8bdca8888cf..29d08145683 100644 --- a/addons/sale_project/static/src/components/project_right_side_panel/components/project_milestone.xml +++ b/addons/sale_project/static/src/components/project_right_side_panel/components/project_milestone.xml @@ -5,13 +5,13 @@ - (%) + (%) - (%) + (%)