Amount to pay of invoice when using amount_payment_clearing is wrong when the paid line is unreconciled
When using account_payment_clearing
, the amount to pay of an invoice can be wrongly computed in the following scenario:
- Create an invoice
- Pay it using a payment with a journal doing a clearing move
- Unreconcile the paid line
- Reconcile the line with another invoice
In this case the amount to pay should take into account the payment amount which is not the case currently.