[10.0][IMP] Set invoices paid - #2611
Merged
Merged
Conversation
pedrobaeza
approved these changes
Mar 16, 2021
Contributor
|
This PR has the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In Odoo 9.0, an invoice was moved from state 'open' to state 'paid'
on reconciliation of the move line that was linked as the trigger of
payment subflow in the invoice workflow. This flow usually prevented
zero amount invoices from getting into state
paidbecause zero amountmove lines are usually not reconciled. The invoice would be marked as
reconciledcorrectly, because there was no residual amount.In Odoo 10.0, any invoice that is marked as
reconciledwill be moved tostate
paidas peraction_invoice_paidthat is triggered from themodel's
_writemethod1. Preemtively set the correct state using SQL herefor performance reasons.
1 https://github.com/odoo/odoo/blob/10.0/addons/account/models/account_invoice.py#L365
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr