In the account move lines we have the “Invoice payment” field, which is only shown in the event that the account move line is not reconciled.
I wonder why this condition exists, and why the value is not always shown, whether the account move line is reconciled or not.
Shouldn’t it always be shown?
I guess you are talking about “Payment Lines”.
For the reasoning you must look at the history: Reconciliation does not fill payment lines (#3112) · Issues · Tryton / Tryton · GitLab
I am talking about the field invoice_payment that is related to the model account.invoice but also available in the model account.move.line
There is no
invoice_payment field on standard invoice.
What you are showing above is an account.move record and not a account.invoice nor account.invoice.line. There is indeed a field invoice_payment in account.move.line and it is used basically to associate partial payments or credit notes to a invoice while it is not fully paid (i.e. reconciled). When we add or remove more partial payments to a balance amount, it can fetch the associated documents and updates the payment lines.
In my opinion if an invoice is paid i.e. reconciled, then the field is no longer needed as there is no balance remaining to pay.
Having this into account, there is no way to see the payment lines that are related to an invoice in the account move view, if the invoice is fully paid?
Don’t you think it may be useful if the user is able to see this information from account moves?
The reconciliation lines are shown since Show reconciliation lines on paid invoice (#8157) · Issues · Tryton / Tryton · GitLab.
But they can show an amount greater than the invoice amount, if some lines are reconciled with multiple invoices.
But I guess the reconciliation lines are shown in the invoice view which I think is okay, but in the account move line view there is not any relation shown between the payment line and the invoice when it is paid.
If you had this relation, you could see payment lines from multiples invoices that are paid from the account move line
The relation exists, it is the reconciliation.
Right, but I think showing as well the field invoice payment would be useful for the user
It is shown as long as there is no reconciliation because once it is reconciled the field may no more contain accurate data. This is because the line may be reconciled differently as how the partial payment was planned.