configuration - add erechnung default report

This commit is contained in:
Frederik Jaeckel 2024-12-06 14:03:51 +01:00
parent 34f3922a44
commit 26388d3816
4 changed files with 146 additions and 3 deletions

View file

@ -7,11 +7,15 @@
from trytond.pool import PoolMeta, Pool from trytond.pool import PoolMeta, Pool
from trytond.model import ModelSQL, fields from trytond.model import ModelSQL, fields
from trytond.modules.company.model import CompanyValueMixin from trytond.modules.company.model import CompanyValueMixin
from .wizard_runreport import sel_edocument
class Configuration(metaclass=PoolMeta): class Configuration(metaclass=PoolMeta):
__name__ = 'account.configuration' __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( xrechn_zugferd_report = fields.MultiValue(fields.Many2One(
model_name='ir.action.report', model_name='ir.action.report',
domain=[ domain=[
@ -25,11 +29,14 @@ class Configuration(metaclass=PoolMeta):
""" select table """ select table
""" """
pool = Pool() pool = Pool()
if field in { if field in {'xrechn_zugferd_report', 'xrechn_default'}:
'xrechn_zugferd_report'}:
return pool.get('account_invoice_xrechnung.configuration') return pool.get('account_invoice_xrechnung.configuration')
return super(Configuration, cls).multivalue_model(field) 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 # end Configuration
@ -37,6 +44,9 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin):
"Account Configuration XRechnung Export" "Account Configuration XRechnung Export"
__name__ = 'account_invoice_xrechnung.configuration' __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( xrechn_zugferd_report = fields.Many2One(
model_name='ir.action.report', model_name='ir.action.report',
string='ZUGFeRD-Report', string='ZUGFeRD-Report',
@ -45,4 +55,8 @@ class ConfigurationXRechnungexport(ModelSQL, CompanyValueMixin):
('extension', '=', 'pdf')], ('extension', '=', 'pdf')],
help='Report that is to be used to generate the ZUGFeRD 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 # end ConfigurationXRechnungexport

View file

@ -98,6 +98,38 @@ msgctxt "help:account.configuration,xrechn_zugferd_report:"
msgid "Report that is to be used to generate the ZUGFeRD PDF." msgid "Report that is to be used to generate the ZUGFeRD PDF."
msgstr "Report, welcher zum erzeugen der ZUGFeRD-PDF verwendet werden soll." 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 # # account_invoice_xrechnung.configuration #
@ -113,3 +145,35 @@ msgstr "ZUGFeRD-Report"
msgctxt "help:account_invoice_xrechnung.configuration,xrechn_zugferd_report:" msgctxt "help:account_invoice_xrechnung.configuration,xrechn_zugferd_report:"
msgid "Report that is to be used to generate the ZUGFeRD PDF." msgid "Report that is to be used to generate the ZUGFeRD PDF."
msgstr "Report, welcher zum erzeugen der ZUGFeRD-PDF verwendet werden soll." 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"

View file

@ -78,6 +78,38 @@ msgctxt "help:account.configuration,xrechn_zugferd_report:"
msgid "Report that is to be used to generate the ZUGFeRD PDF." msgid "Report that is to be used to generate the ZUGFeRD PDF."
msgstr "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:" msgctxt "model:account_invoice_xrechnung.configuration:"
msgid "Account Configuration XRechnung Export" msgid "Account Configuration XRechnung Export"
msgstr "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:" msgctxt "help:account_invoice_xrechnung.configuration,xrechn_zugferd_report:"
msgid "Report that is to be used to generate the ZUGFeRD PDF." msgid "Report that is to be used to generate the ZUGFeRD PDF."
msgstr "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"

View file

@ -9,7 +9,8 @@
<separator id="xrechnung" colspan="4" string="ZUGFeRD - e-Invoice"/> <separator id="xrechnung" colspan="4" string="ZUGFeRD - e-Invoice"/>
<label name="xrechn_zugferd_report"/> <label name="xrechn_zugferd_report"/>
<field name="xrechn_zugferd_report"/> <field name="xrechn_zugferd_report"/>
<newline/> <label name="xrechn_default"/>
<field name="xrechn_default"/>
</xpath> </xpath>