asset: bereichsgrenzen für currency_digits, farbe rot für tagesnegativ

This commit is contained in:
Frederik Jaeckel 2022-12-05 21:02:17 +01:00
parent 331c62a3f6
commit 6b3b44e9af
2 changed files with 21 additions and 2 deletions

View file

@ -7,6 +7,7 @@ from trytond.tests.test_tryton import ModuleTestCase, with_transaction
from trytond.pool import Pool
from trytond.modules.company.tests import create_company
from trytond.transaction import Transaction
from trytond.exceptions import UserError
from decimal import Decimal
from datetime import time, date, datetime
@ -75,6 +76,8 @@ class AssetTestCase(ModuleTestCase):
def test_asset_create(self):
""" create asset
"""
Asset = Pool().get('investment.asset')
company = self.prep_asset_company()
product = self.prep_asset_product(
name='Product 1',
@ -85,6 +88,19 @@ class AssetTestCase(ModuleTestCase):
product = product)
self.assertEqual(asset.symbol, 'usd/u')
# check ranges
Asset.write(*[
[asset],
{
'currency_digits': 1,
}])
self.assertRaisesRegex(UserError,
'ss',
Asset.write,
*[[asset], {
'currency_digits': -1,
}])
@with_transaction()
def test_asset_rec_name(self):
""" create asset