How to unpay invoice in order to cancel and reinvoice third party and credit payments made by a manual move

This is not the first time we’ve had this case, but it is the first time under tryton.

A works project is underway and has had a couple of monthly advancement invoices made (and paid).
Then an amendment was made to change the company being invoiced (same group, but different entity).

We need to unpay the previously paid invoices in order to reconcile with the complete credit note made for the facturation made but tryton does not let us de-reconcile, saying we cannot modify the invoice because it is posted, paid or cancelled.

It must always be possibile to unpay an invoice, which could always be by error.
How to do this?
BTW, we’re on 5.4

You can always unreconcile any lines but you must use the “unreconcile wizard” on the move line.

? that’s what I thought.

Via account plan, I open the account 411114 (for us, clients@20% tva), filter on the party and then I select one of the lines reconciled

neither right click->action->de-reconcile nor via the menu bar (which should be the same) work, I get the message indicated above.

Is it possible some other module is muddying things, such as account_tax_cash or something?
Or perhaps something missing in the value of _check_modify_exclude (used in check_modify())

What is exactly the error message?
Or even better the full traceback.

Without a full traceback it is not possible to know which code wrongly modify the invoice.

Quickly, this is about the best I can do…

It would be better to copy/past the traceback text so it can be searchable by other having the same issue.

It looks like it is an invoice that was numbered before the activation on account_invoice_history so the numbered_at was not filled and now the processing of the invoice try to set it.
Even if it is a rare case, I created Issue 8907: Allow to set numbered_at after posting - Tryton issue tracker

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.