diff --git a/configuration.py b/configuration.py index b308c5e..f4bedb2 100644 --- a/configuration.py +++ b/configuration.py @@ -7,11 +7,15 @@ from trytond.pool import PoolMeta, Pool from trytond.model import ModelSQL, fields from trytond.modules.company.model import CompanyValueMixin +from .wizard_runreport import sel_edocument class Configuration(metaclass=PoolMeta): __name__ = 'account.configuration' + xrechn_default = fields.MultiValue(fields.Selection( + string='Export mode', selection=sel_edocument, + help='Pre-set export format for e-invoices.')) xrechn_zugferd_report = fields.MultiValue(fields.Many2One( model_name='ir.action.report', domain=[ @@ -25,11 +29,14 @@ class Configuration(metaclass=PoolMeta): """ select table """ pool = Pool() - if field in { - 'xrechn_zugferd_report'}: + if field in {'xrechn_zugferd_report', 'xrechn_default'}: return pool.get('account_invoice_xrechnung.configuration') return super(Configuration, cls).multivalue_model(field) + @classmethod + def default_xrechn_default(cls, **pattern): + return cls.multivalue_model('xrechn_default').default_xrechn_default() + # end Configuration @@ -37,6 +44,9 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin): "Account Configuration XRechnung Export" __name__ = 'account_invoice_xrechnung.configuration' + xrechn_default = fields.Selection( + string='Export mode', selection=sel_edocument, + help='Pre-set export format for e-invoices.') xrechn_zugferd_report = fields.Many2One( model_name='ir.action.report', string='ZUGFeRD-Report', @@ -45,4 +55,8 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin): ('extension', '=', 'pdf')], help='Report that is to be used to generate the ZUGFeRD PDF.') + @classmethod + def default_xrechn_default(cls, **pattern): + return 'edocument.facturxext.invoice-ferd' + # end ConfigurationXRechnungexport diff --git a/locale/de.po b/locale/de.po index ff22ba4..ee1a86c 100644 --- a/locale/de.po +++ b/locale/de.po @@ -98,6 +98,38 @@ msgctxt "help:account.configuration,xrechn_zugferd_report:" msgid "Report that is to be used to generate the ZUGFeRD PDF." msgstr "Report, welcher zum erzeugen der ZUGFeRD-PDF verwendet werden soll." +msgctxt "field:account.configuration,xrechn_default:" +msgid "Export mode" +msgstr "Exportformat" + +msgctxt "help:account.configuration,xrechn_default:" +msgid "Pre-set export format for e-invoices." +msgstr "Voreingstelltes Exportformat für die eRechnung." + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.2" +msgstr "XRechnung UBL Invoice 2.2" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.3" +msgstr "XRechnung UBL Invoice 2.3" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 3.0" +msgstr "XRechnung UBL Invoice 3.0" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "Factur-X Extended" +msgstr "Factur-X Extended" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "ZUGFeRD 2.3.2" +msgstr "ZUGFeRD 2.3.2" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "CII CrossIndustryInvoice D16B" +msgstr "CII CrossIndustryInvoice D16B" + ########################################### # account_invoice_xrechnung.configuration # @@ -113,3 +145,35 @@ msgstr "ZUGFeRD-Report" msgctxt "help:account_invoice_xrechnung.configuration,xrechn_zugferd_report:" msgid "Report that is to be used to generate the ZUGFeRD PDF." msgstr "Report, welcher zum erzeugen der ZUGFeRD-PDF verwendet werden soll." + +msgctxt "field:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Export mode" +msgstr "Exportformat" + +msgctxt "help:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Pre-set export format for e-invoices." +msgstr "Voreingstelltes Exportformat für die eRechnung." + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.2" +msgstr "XRechnung UBL Invoice 2.2" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.3" +msgstr "XRechnung UBL Invoice 2.3" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 3.0" +msgstr "XRechnung UBL Invoice 3.0" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Factur-X Extended" +msgstr "Factur-X Extended" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "ZUGFeRD 2.3.2" +msgstr "ZUGFeRD 2.3.2" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "CII CrossIndustryInvoice D16B" +msgstr "CII CrossIndustryInvoice D16B" diff --git a/locale/en.po b/locale/en.po index ad72eda..305b6db 100644 --- a/locale/en.po +++ b/locale/en.po @@ -78,6 +78,38 @@ msgctxt "help:account.configuration,xrechn_zugferd_report:" msgid "Report that is to be used to generate the ZUGFeRD PDF." msgstr "Report that is to be used to generate the ZUGFeRD PDF." +msgctxt "field:account.configuration,xrechn_default:" +msgid "Export mode" +msgstr "Export mode" + +msgctxt "help:account.configuration,xrechn_default:" +msgid "Pre-set export format for e-invoices." +msgstr "Pre-set export format for e-invoices." + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.2" +msgstr "XRechnung UBL Invoice 2.2" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.3" +msgstr "XRechnung UBL Invoice 2.3" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 3.0" +msgstr "XRechnung UBL Invoice 3.0" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "Factur-X Extended" +msgstr "Factur-X Extended" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "ZUGFeRD 2.3.2" +msgstr "ZUGFeRD 2.3.2" + +msgctxt "selection:account.configuration,xrechn_default:" +msgid "CII CrossIndustryInvoice D16B" +msgstr "CII CrossIndustryInvoice D16B" + msgctxt "model:account_invoice_xrechnung.configuration:" msgid "Account Configuration XRechnung Export" msgstr "Account Configuration XRechnung Export" @@ -89,3 +121,35 @@ msgstr "ZUGFeRD-Report" msgctxt "help:account_invoice_xrechnung.configuration,xrechn_zugferd_report:" msgid "Report that is to be used to generate the ZUGFeRD PDF." msgstr "Report that is to be used to generate the ZUGFeRD PDF." + +msgctxt "field:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Export mode" +msgstr "Export mode" + +msgctxt "help:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Pre-set export format for e-invoices." +msgstr "Pre-set export format for e-invoices." + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.2" +msgstr "XRechnung UBL Invoice 2.2" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 2.3" +msgstr "XRechnung UBL Invoice 2.3" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "XRechnung UBL Invoice 3.0" +msgstr "XRechnung UBL Invoice 3.0" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "Factur-X Extended" +msgstr "Factur-X Extended" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "ZUGFeRD 2.3.2" +msgstr "ZUGFeRD 2.3.2" + +msgctxt "selection:account_invoice_xrechnung.configuration,xrechn_default:" +msgid "CII CrossIndustryInvoice D16B" +msgstr "CII CrossIndustryInvoice D16B" diff --git a/view/configuration_form.xml b/view/configuration_form.xml index 94b22b3..9e4b01f 100644 --- a/view/configuration_form.xml +++ b/view/configuration_form.xml @@ -9,7 +9,8 @@