[FIX] account_edi_ubl_cii: float_repr should not be used for rounding
The `format_float` function is calling `float_repr`, which should not be used for rounding operation (see its docstring). Instead, we should use the `float_round` function. opw-3171987 closes odoo/odoo#113631 X-original-commit: 0267c0d11ad1a5882aa5520bbf9455156b83149c Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com> Signed-off-by: Julien Van Roy <juvr@odoo.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from odoo import _, models, Command
|
||||
from odoo.tools import float_repr
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools.float_utils import float_round
|
||||
|
||||
from zeep import Client
|
||||
|
||||
@@ -94,7 +95,7 @@ class AccountEdiCommon(models.AbstractModel):
|
||||
def format_float(self, amount, precision_digits):
|
||||
if amount is None:
|
||||
return None
|
||||
return float_repr(amount, precision_digits)
|
||||
return float_repr(float_round(amount, precision_digits), precision_digits)
|
||||
|
||||
def _get_uom_unece_code(self, line):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user