20 lines
		
	
	
		
			751 B
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			751 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 api, fields, models
 | |
| from odoo.exceptions import ValidationError
 | |
| 
 | |
| class AccountInvoice(models.TransientModel):
 | |
|     _name = 'wizard.confirm.null_invoice'
 | |
|     _description = 'Bestätige Nullrechnung'
 | |
| 
 | |
|     @api.one
 | |
|     def button_confirm_null_invoice(self):
 | |
|         invoice_ids = self._context.get('active_ids')
 | |
|         if invoice_ids is None:
 | |
|             return {'type': 'ir.actions.act_window_close'}
 | |
|         invoice = self.env['account.invoice'].browse(invoice_ids)
 | |
|         res = invoice.with_context(confirmed=True).action_invoice_open()
 | |
| 
 | |
|         return res
 |