[IMP] Remove the to pay mark on an invoice when it is fully paid on in payment #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Presently, the module only works with the register payment button, which seems quite problematic, as it is normally not very used when the full accounting is done in Odoo.
Indeed, if you pay your invoice by wire transfer, the payment will come from your bank statement or from an
account.payment.order
for instance.So the main change here is that the
selected_for_payment
is computed so it is removed when invoice is paid or in payment.This PR includes other small improvement like :
Last thing, I think it is very weird to remove the
selected_for_payment
mark if one user click on the register payment button but does not proceed to the payamnt (cancel it).I would remove the override of
action_register_payment
and only rely on the computed field to remove it...Still I did not do it in this PR because I am not sure it is ok for everybody, and I do not really have a solution for the partial payment case.
An equivalent PR actually was already proposed/approved in v14, but was never merged see : OCA#1317
FYI @aleuffre @renda-dev