edocument_xrechnung/configuration.py

36 lines
1.1 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# This file is part of the edocument-module for Tryton from m-ds.de.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
from trytond.pool import PoolMeta
from trytond.model import ModelSQL, fields
class Configuration(metaclass=PoolMeta):
__name__ = 'account.configuration'
edocument_bank = fields.Many2Many(
string='Bank accounts',
relation_name='edocument_xrechnung.bank_rel',
origin='config', target='bankaccount',
filter=[('company_owned', '=', True)],
help='The bank accounts listed here are output in the invoice XML.')
# end Configuration
class BankEdocumentRel(ModelSQL):
'Bank - eDocument - Relation'
__name__ = 'edocument_xrechnung.bank_rel'
bankaccount = fields.Many2One(
string='Account', model_name='bank.account.number',
required=True, ondelete='CASCADE')
config = fields.Many2One(
string='Configuration', model_name='account.configuration',
required=True, ondelete='CASCADE')
# end BankEdocumentRel