online update ...

This commit is contained in:
Frederik Jaeckel 2022-11-19 00:21:52 +01:00
parent f8ba90d633
commit d54f3805ab
13 changed files with 453 additions and 4 deletions

31
update_wiz.py Normal file
View file

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# 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.
from trytond.wizard import Wizard, StateTransition
from trytond.pool import Pool
from trytond.transaction import Transaction
class UpdateSoureWizard(Wizard):
'Update Source'
__name__ = 'investment.source_update'
start_state = 'runupdate'
runupdate = StateTransition()
def transition_runupdate(self):
""" update selected sources
"""
pool = Pool()
OnlineSource = pool.get('investment.source')
Asset = pool.get('investment.asset')
context = Transaction().context
assets = Asset.browse(context.get('active_ids', []))
for asset in assets:
OnlineSource.update_rate(asset)
return 'end'
# UpdateSoureWizard