[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 <awt@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
This commit is contained in:
+2
-2
@@ -5,13 +5,13 @@
|
||||
<span>
|
||||
<t t-esc="milestone.name"/>
|
||||
<span t-if="milestone.allow_billable && milestone.quantity_percentage && !milestone.sale_line_name" class="fst-italic text-muted">
|
||||
(<t t-esc="100 * milestone.quantity_percentage"/>%)
|
||||
(<t t-esc="(100 * milestone.quantity_percentage).toFixed(2)"/>%)
|
||||
</span>
|
||||
</span>
|
||||
<span t-if="milestone.allow_billable" t-attf-class="fst-italic {{state.colorClass || 'text-muted'}}">
|
||||
<t t-if="milestone.sale_line_name" t-esc="milestone.sale_line_name"/>
|
||||
<span t-if="milestone.quantity_percentage && milestone.sale_line_name">
|
||||
(<t t-esc="100 * milestone.quantity_percentage"/>%)
|
||||
(<t t-esc="(100 * milestone.quantity_percentage).toFixed(2)"/>%)
|
||||
</span>
|
||||
</span>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user