Delete an invoice after validation? (Odoo 8)
Install the account_cancel module. Go to file: sudo nano <odoo>/addons/account/account_invoice.py Comment the function unlink like:
1 2 3 4 5 6 7 8 |
@api.multi def unlink(self): #for invoice in self: #if invoice.state not in ('draft', 'cancel'): #raise UserError(_('You cannot delete an invoice which is not draft or cancelled. You should refund it instead.')) #elif invoice.move_name: #raise UserError(_('You cannot delete an invoice after it has been validated (and received a number). You can set it back to "Draft" state and modify its content, then re-confirm it.')) return super(AccountInvoice, self).unlink() |
Restart Odoo server. Go to the accounting view and remove the canceled invoice(s).