[account_statement_import_online_plaid] Exclude pending transactions - #955
Open
Daniel15 wants to merge 2 commits into
Open
[account_statement_import_online_plaid] Exclude pending transactions#955Daniel15 wants to merge 2 commits into
Daniel15 wants to merge 2 commits into
Conversation
Author
|
@antoniodavid can you please review this? |
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.
Plaid import currently includes pending transactions. When the pending transaction gets posted, Odoo ends up with two different transactions.
This is because the posted transaction has a different Plaid transaction ID (and thus a different
unique_import_id) to the pending one. Plaid does provide the transaction ID of the pending transaction on the posted transaction in order to link the two together, but this addon doesn't currently use that.This PR takes the easiest approach to fix this: Just ignore pending transactions. This is consistent with what's done for all the other providers: Either they use an API that only returns posted transactions (e.g. Stripe's
balance_transactions), or they filter out pending transactions (e.g. GoCardless usestransactions.get("transactions", {}).get("booked", [])). This also makes sense conceptually, as it doesn't make sense to reconcile transactions before they're finalized.