Merge branch 'main' into 5.0

This commit is contained in:
Frederik Jaeckel 2025-01-29 09:56:59 +01:00
commit f944b9019c

View file

@ -4,13 +4,13 @@
# full copyright notices and license terms. # full copyright notices and license terms.
from decimal import Decimal, ROUND_HALF_EVEN from decimal import Decimal
import html import html
from trytond.exceptions import UserError from trytond.exceptions import UserError
from trytond.modules.tryton6_backport.i18n import gettext from trytond.modules.tryton6_backport.i18n import gettext
from cached_property import cached_property from cached_property import cached_property
from trytond.pool import Pool from trytond.pool import Pool
from trytond.modules.product import price_digits from trytond.modules.product import round_price
class EdocumentMixin(object): class EdocumentMixin(object):
@ -193,10 +193,8 @@ class EdocumentMixin(object):
Returns: Returns:
Decimal: rounded value Decimal: rounded value
""" """
if isinstance(value, Decimal): if value is not None:
return value.quantize( return round_price(value)
Decimal(str(1/10 ** price_digits[1])),
ROUND_HALF_EVEN)
return value return value
def quote_text(self, text): def quote_text(self, text):