diff options
| author | nouraellm <nea@odoo.com> | 2021-05-03 21:11:55 +0000 |
|---|---|---|
| committer | nouraellm <nea@odoo.com> | 2021-05-04 07:59:19 +0000 |
| commit | c69fb8ec6828676a1900c56f1e87df809b6b70c2 (patch) | |
| tree | 33a8c98c241d9a3b235e1844a2b4e69eb4ed6192 /addons | |
| parent | 073a4a3d1dbc8ac973c963c6b53d23ba1635bfe4 (diff) | |
[FIX] stock, mrp: Fix precision overflow in forecasted report
- Fix tends to prevent precision overflow in forecasted report
Current behavior before PR:
- If there are 2 units in stock and product_uom_qty is set to 0.66 the free_stock will be equal to 1.3399999999999999
Desired behavior after PR is merged:
- If there are 2 units in stock and product_uom_qty is set to 0.66 the free_stock should be equal to 1.34
opw-2425473
opw-2459650
opw-2448443
opw-2446985
opw-2440853
opw-2464507
closes odoo/odoo#70287
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/stock/report/report_stock_forecasted.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/report/report_stock_forecasted.py b/addons/stock/report/report_stock_forecasted.py index c47b42e1d7e..80844230f95 100644 --- a/addons/stock/report/report_stock_forecasted.py +++ b/addons/stock/report/report_stock_forecasted.py @@ -4,7 +4,7 @@ from collections import defaultdict from odoo import api, models -from odoo.tools import float_is_zero, format_datetime, format_date +from odoo.tools import float_is_zero, format_datetime, format_date, float_round class ReplenishmentReport(models.AbstractModel): @@ -125,7 +125,7 @@ class ReplenishmentReport(models.AbstractModel): 'receipt_date': format_datetime(self.env, move_in.date, timezone, dt_format=False) if move_in else False, 'delivery_date': format_datetime(self.env, move_out.date, timezone, dt_format=False) if move_out else False, 'is_late': is_late, - 'quantity': quantity, + 'quantity': float_round(quantity, precision_rounding=product.uom_id.rounding), 'move_out': move_out, 'move_in': move_in, 'reservation': reservation, |
