# -*- 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