# -*- coding: utf-8 -*- # This file is part of the cashbook-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.transaction import Transaction from trytond.pool import Pool from trytond.model import ModelView, fields from trytond.wizard import Wizard, StateTransition, StateView, Button from trytond.transaction import Transaction class ImportQifWizardStart(ModelView): 'Import QIF-File' __name__ = 'cashbook_dataexchange.qif_imp_wiz.start' company = fields.Many2One(model_name='company.company', string="Company", required=True, states={'invisible': True}) file_ = fields.Binary(string="QIF-File", required=True, help='Quicken Interchange Format') @classmethod def default_company(cls): return Transaction().context.get('company') # end ImportQifWizardStart class ImportQifWizard(Wizard): 'Import QIF-File' __name__ = 'cashbook_dataexchange.qif_imp_wiz' start_state = 'start' start = StateView(model_name='cashbook_dataexchange.qif_imp_wiz.start', \ view='cashbook_dataexchange.qif_imp_wiz_start_form', \ buttons=[ Button(string='Cancel', state='end', icon='tryton-cancel'), Button(string='Read File', state='readf', icon='tryton-forward', default=True), ]) # end ImportQifWizard