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

**URL:** https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047
**Category:** User
**Created:** [December 6, 2019, 2:39pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047 "2019-12-06T14:39:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [December 6, 2019, 2:39pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/1 "2019-12-06T14:39:58Z")

</div>

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  
cheers

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 6, 2019, 4:12pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/2 "2019-12-06T16:12:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [December 6, 2019, 4:34pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/3 "2019-12-06T16:34:18Z")

</div>

? 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()`)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 6, 2019, 6:02pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/4 "2019-12-06T18:02:20Z")

</div>

> [@risto3](#):
>
> I get the message indicated above

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

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [December 7, 2019, 12:29pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/5 "2019-12-07T12:29:21Z")

</div>

![Capture%20d%E2%80%99%C3%A9cran%20du%202019-12-07%2013-25-58](https://discuss-cdn.tryton.org/uploads/default/original/1X/675b727566a54b11c129ee093c54485947768be8.png)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 7, 2019, 2:07pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/6 "2019-12-07T14:07:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [December 7, 2019, 5:28pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/7 "2019-12-07T17:28:26Z")

</div>

Quickly, this is about the best I can do…

 ![Capture%20d%E2%80%99%C3%A9cran%20du%202019-12-07%2018-16-32](https://discuss-cdn.tryton.org/uploads/default/original/1X/61ebd6a8d1db8ea2e4d988c165e7331d3dc3f2cd.png)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 7, 2019, 10:43pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/8 "2019-12-07T22:43:24Z")

</div>

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 [Allow to set numbered\_at after posting (#8907) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8907)

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [January 6, 2020, 10:43pm UTC](https://discuss.tryton.org/t/how-to-unpay-invoice-in-order-to-cancel-and-reinvoice-third-party-and-credit-payments-made-by-a-manual-move/2047/9 "2020-01-06T22:43:32Z")

</div>

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