export of xrechnung 2.2 + 2.3 + 3.0

This commit is contained in:
Frederik Jaeckel 2024-12-05 11:28:44 +01:00
parent 85e412564c
commit 0b5f4633a8
4 changed files with 48 additions and 6 deletions

View file

@ -12,12 +12,16 @@ from trytond.transaction import Transaction
sel_edocument = [
('edocument.xrechnung.invoice', 'XRechnung UBL Invoice 2.1.1'),
('edocument.xrechnung.invoice-2.2', 'XRechnung UBL Invoice 2.2'),
('edocument.xrechnung.invoice-2.3', 'XRechnung UBL Invoice 2.3'),
('edocument.xrechnung.invoice-3.0', 'XRechnung UBL Invoice 3.0'),
('edocument.uncefact.invoice', 'CII CrossIndustryInvoice D16B'),
]
edoc_versions = {
'edocument.xrechnung.invoice': 'XRechnung-2.2',
'edocument.xrechnung.invoice-2.2': 'XRechnung-2.2',
'edocument.xrechnung.invoice-2.3': 'XRechnung-2.3',
'edocument.xrechnung.invoice-3.0': 'XRechnung-3.0',
'edocument.uncefact.invoice': '16B-CII'}
@ -44,7 +48,7 @@ class RunXRechnungReportStart(ModelView):
def default_edocument(cls):
""" default xrechnung
"""
return 'edocument.xrechnung.invoice'
return 'edocument.xrechnung.invoice-3.0'
# end RunXRechnungReportStart
@ -67,11 +71,13 @@ class RunXRechnungReport(Wizard):
""" set defaults
"""
context = Transaction().context
Invoice = Pool().get('account.invoice')
pool = Pool()
Invoice = pool.get('account.invoice')
WizRepStart = pool.get('account_invoice_xrechnung.runrep.start')
invoice = Invoice.browse([context.get('active_id', -1)])
result = {
'edocument': 'edocument.xrechnung.invoice',
'edocument': WizRepStart.default_edocument(),
'invoice': context.get('active_id', -1),
'state': invoice[0].state if invoice else ''}
return result