Merge branch 'main' into 6.8

This commit is contained in:
Frederik Jaeckel 2025-01-29 09:42:20 +01:00
commit 784a447d35

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.i18n import gettext
from trytond.tools 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):