21 lines
		
	
	
		
			756 B
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			756 B
		
	
	
	
		
			Python
		
	
	
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
 | 
						|
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
 | 
						|
 | 
						|
from odoo import fields, models
 | 
						|
 | 
						|
 | 
						|
class ConfirmPrintInvoice(models.TransientModel):
 | 
						|
    _name = 'wizard.confirm_print_invoice'
 | 
						|
    _description = 'Bestätige Rechnungsdruck'
 | 
						|
    _order = 'name'
 | 
						|
 | 
						|
    info = fields.Text('Info', readonly=True)
 | 
						|
 | 
						|
    def print_invoice(self):
 | 
						|
        self.ensure_one()
 | 
						|
        invoice = self.env['account.invoice'].browse(self.env.context.get('invoice_ids', []))
 | 
						|
        if not invoice:
 | 
						|
            return {'type': 'ir.actions.act_window_close'}
 | 
						|
 | 
						|
        return self.env.ref('dp_reports_account.account_invoices_with_intrastat').report_action(invoice)
 |