configuration: add setting for used bank nuumbers

This commit is contained in:
Frederik Jaeckel 2024-12-10 12:25:51 +01:00
parent 0165d56115
commit 5d0032880c
7 changed files with 117 additions and 0 deletions

View file

@ -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,

35
configuration.py Normal file
View file

@ -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

15
configuration.xml Normal file
View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!-- 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. -->
<tryton>
<data>
<record model="ir.ui.view" id="configuration_view_form">
<field name="model">account.configuration</field>
<field name="inherit" ref="account.configuration_view_form"/>
<field name="name">configuration_form</field>
</record>
</data>
</tryton>

View file

@ -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"

View file

@ -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"

View file

@ -7,4 +7,5 @@ depends:
account_invoice
xml:
message.xml
configuration.xml
party.xml

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!-- This file is part of the account-datev-module from m-ds for Tryton.
The COPYRIGHT file at the top level of this repository contains the
full copyright notices and license terms. -->
<data>
<xpath expr="/form/separator[@id='currency_exchange']" position="before">
<separator id="edocument" colspan="4" string="eDocument"/>
<field name="edocument_bank" colspan="2" height="200"/>
<newline/>
</xpath>
</data>