wizard für export
This commit is contained in:
parent
458dfecf72
commit
7b160d84af
5 changed files with 63 additions and 3 deletions
36
wizard_runreport.py
Normal file
36
wizard_runreport.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This file is part of the cashbook-module from m-ds for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelView, fields
|
||||
from trytond.wizard import Wizard, StateAction
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
class RunXRechnungReport(Wizard):
|
||||
'XRechnung Report'
|
||||
__name__ = 'account_invoice_xrechnung.runrep'
|
||||
|
||||
start_state = 'open_'
|
||||
#report_ = StateReport('cashbook.reprecon')
|
||||
open_ = StateAction('account_invoice.act_invoice_form')
|
||||
|
||||
def do_open_(self, action):
|
||||
""" run form
|
||||
"""
|
||||
pool = Pool()
|
||||
Invoice = pool.get('account.invoice')
|
||||
EDocument = pool.get('edocument.xrechnung.invoice')
|
||||
context = Transaction().context
|
||||
|
||||
invoice, = Invoice.browse([context.get('active_id', -1)])
|
||||
template = EDocument(invoice)
|
||||
invoice_string = template.render('XRechnung-2.2')
|
||||
print('\n## invoice_string:', invoice_string.decode('utf8'))
|
||||
|
||||
|
||||
return action, {}
|
||||
|
||||
# end RunXRechnungReport
|
Loading…
Add table
Add a link
Reference in a new issue