diff --git a/__init__.py b/__init__.py index 9d78ad7..a7f7f9c 100644 --- a/__init__.py +++ b/__init__.py @@ -7,12 +7,15 @@ from trytond.pool import Pool from .edocument import XRechnung, FacturX from .bank import AccountNumber from .party import PartyConfiguration, Party +from .configuration import Configuration, BankEdocumentRel def register(): Pool.register( AccountNumber, XRechnung, + Configuration, + BankEdocumentRel, FacturX, Party, PartyConfiguration, diff --git a/configuration.py b/configuration.py new file mode 100644 index 0000000..d0aa911 --- /dev/null +++ b/configuration.py @@ -0,0 +1,35 @@ +# -*- 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 diff --git a/configuration.xml b/configuration.xml new file mode 100644 index 0000000..630a828 --- /dev/null +++ b/configuration.xml @@ -0,0 +1,15 @@ + + + + + + + account.configuration + + configuration_form + + + + diff --git a/locale/de.po b/locale/de.po index d8156a9..aaaa604 100644 --- a/locale/de.po +++ b/locale/de.po @@ -113,3 +113,31 @@ msgstr "Allgemeine indirekte Steuer der kanarischen Inseln" msgctxt "selection:account.tax,xrtax_category:" msgid "Tax on production; services and imports in Ceuta and Melilla" msgstr "Steuer für Produktion; Dienstleistungen und Einfuhr in Ceuta und Melilla" + + +######################### +# account.configuration # +######################### +msgctxt "field:account.configuration,edocument_bank:" +msgid "Bank accounts" +msgstr "Bankkonten" + +msgctxt "help:account.configuration,edocument_bank:" +msgid "The bank accounts listed here are output in the invoice XML." +msgstr "Die hier aufgeführten Bankkonten werden in der Rechnungs-XML ausgegeben." + + +################################ +# edocument_xrechnung.bank_rel # +################################ +msgctxt "model:edocument_xrechnung.bank_rel,name:" +msgid "Bank - eDocument - Relation" +msgstr "Bank - eDocument - Verknüpfung" + +msgctxt "field:edocument_xrechnung.bank_rel,bankaccount:" +msgid "Account" +msgstr "Konto" + +msgctxt "field:edocument_xrechnung.bank_rel,config:" +msgid "Configuration" +msgstr "Konfiguration" diff --git a/locale/en.po b/locale/en.po index a4978ea..b0353ce 100644 --- a/locale/en.po +++ b/locale/en.po @@ -98,3 +98,23 @@ msgctxt "selection:account.tax,xrtax_category:" msgid "Tax on production; services and imports in Ceuta and Melilla" msgstr "Tax on production; services and imports in Ceuta and Melilla" +msgctxt "field:account.configuration,edocument_bank:" +msgid "Bank accounts" +msgstr "Bank accounts" + +msgctxt "help:account.configuration,edocument_bank:" +msgid "The bank accounts listed here are output in the invoice XML." +msgstr "The bank accounts listed here are output in the invoice XML." + +msgctxt "model:edocument_xrechnung.bank_rel,name:" +msgid "Bank - eDocument - Relation" +msgstr "Bank - eDocument - Relation" + +msgctxt "field:edocument_xrechnung.bank_rel,bankaccount:" +msgid "Account" +msgstr "Account" + +msgctxt "field:edocument_xrechnung.bank_rel,config:" +msgid "Configuration" +msgstr "Configuration" + diff --git a/tryton.cfg b/tryton.cfg index 8552590..4d83b5f 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -7,4 +7,5 @@ depends: account_invoice xml: message.xml + configuration.xml party.xml diff --git a/view/configuration_form.xml b/view/configuration_form.xml new file mode 100644 index 0000000..244d830 --- /dev/null +++ b/view/configuration_form.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + +