use product.round_price() to round unit_price of invoice-line
This commit is contained in:
parent
02221601e7
commit
ea5a83d7c1
1 changed files with 4 additions and 6 deletions
10
mixin.py
10
mixin.py
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue