Can not remove reconciliation when an invoice line was defered
Modules
Activated modules: acocunt_invoice + account_invoice_defered
Scenario:
First:
- Create an invoice. Add new lines: service product and defered_to/defered_from dates
- Post the invoice.
In "Invoices / Defered" menu, you could find a new record related to invoice line. You could do "run" button.
Second:
- Paid the invoice. A new reconciliation has been created.
- Finally, try to delete the reconciliation in account move. An user message show:
Invoice line can be deferred only once
User can not remove the reconciliation and can not delete defered when is in closed state.
The reason is because when delete reconciliation, call Invoice._post() and try to create a new deferred (account.invoice.deferred) [1]
Trace to delete reconciliation:
Reconciliation.delete(delete_reconciliation)
Invoice.process(invoices)
Invoice.post(posted)
Invoice._post(invoices)