asset: aktueller kurs-anzeige, online-update begonnen

This commit is contained in:
Frederik Jaeckel 2022-11-14 23:03:54 +01:00
parent 42ede3decb
commit a936d85043
13 changed files with 317 additions and 5 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# This file is part of the cashbook-module from m-ds for Tryton.
# This file is part of the investment-module from m-ds for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
@ -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 decimal import Decimal
from datetime import time
class AssetTestCase(ModuleTestCase):
@ -79,6 +80,43 @@ class AssetTestCase(ModuleTestCase):
company=company,
product = product)
@with_transaction()
def test_asset_check_onlinesource_onoff(self):
""" create asset, switch online-source on/off
"""
pool = Pool()
OnlineSource = pool.get('investment.source')
Asset = pool.get('investment.asset')
company = self.prep_asset_company()
product = self.prep_asset_product(
name='Product 1',
description='some asset')
asset = self.prep_asset_item(
company=company,
product = product)
o_source, = OnlineSource.create([{
'name': 'Source 1',
}])
self.assertEqual(asset.updtsource, None)
self.assertEqual(asset.updttime1, None)
self.assertEqual(asset.updttime2, None)
self.assertEqual(asset.updttime3, None)
asset.updtsource = o_source
asset.updttime1 = time(10, 45)
asset.save()
self.assertEqual(asset.updtsource.rec_name, 'Source 1')
self.assertEqual(asset.updttime1, time(10, 45))
asset.updtsource = None
asset.on_change_updtsource()
self.assertEqual(asset.updtsource, None)
self.assertEqual(asset.updttime1, None)
@with_transaction()
def test_asset_indentifiers(self):
""" create asset, add identifiers

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# This file is part of the cashbook-module from m-ds for Tryton.
# This file is part of the investment-module from m-ds for Tryton.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.