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.
from decimal import Decimal, ROUND_HALF_EVEN
from decimal import Decimal
import html
from trytond.exceptions import UserError
from trytond.modules.tryton6_backport.i18n import gettext
from cached_property import cached_property
from trytond.pool import Pool
from trytond.modules.product import price_digits
from trytond.modules.product import round_price
class EdocumentMixin(object):
@ -193,10 +193,8 @@ class EdocumentMixin(object):
Returns:
Decimal: rounded value
"""
if isinstance(value, Decimal):
return value.quantize(
Decimal(str(1/10 ** price_digits[1])),
ROUND_HALF_EVEN)
if value is not None:
return round_price(value)
return value
def quote_text(self, text):