Syncing from upstream OCA/bank-statement-import (19.0) - #785
Merged
Conversation
This module provides online bank statements from GoCardless Bank Account Data, which provides a free API for connecting and getting transactions for bank accounts. TT45760 Co-Authored-By: Christopher Ormaza <chris.ormaza@forgeflow.com> Co-Authored-By: Jordi Ballester <jordi.ballester@forgeflow.com>
Not all banks provide an entry reference or transaction ID, so we need to fallback to the Gocardless internal ID for getting the unique ID in such cases. TT46640
… company If the bank account is shared across multiple companies (no assigned company_id), we can't launch the "Select Bank Account Identifier" wizard, so we fallback to the journal company for getting the country. TT43849
Not sure why it didn't raise before.
…xtraction Since one week ago, banks like Sabadell is sending the information in the JSON list `remittanceInformationUnstructuredArray` instead of `remittanceInformationUnstructured`. Thus, we need to parse both for finding the proper element. For the rest that are using the previous one, there's no change. TT47491
…rom other provider Check if there's another provider already linked for the same bank institution, and if so, reuse it for this bank account, as some banks don't allow several requisitions from the same source (GoCardless). TT47944
It turns out that the timeout is for receiving whole answer, so in real tests, the previous timeout was not enough for getting the answer when there are some transactions load (like a month). Let's increase this timeout then to a reasonable amount.
Currently translated at 100.0% (23 of 23 strings) Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_online_gocardless Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online_gocardless/es/
Currently translated at 100.0% (23 of 23 strings) Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_online_gocardless Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online_gocardless/es/
… if reusing or not credentials Some banks only allow one credentials, while others work better with separate ones, so it's a matter of trying. This commit introduces a wizard for choosing one method or the other. TT48828
It is possible that, when making the request to the requisitions endpoint, the IBAN bank account comes with a lower alphanumeric string. When comparing with the sanitized bank account (stored with upper) fails. self.journal_id.bank_account_id.sanitized_acc_number == account_data["iban"] to self.journal_id.bank_account_id.sanitized_acc_number == account_data["iban"].upper() Refactor method _gocardless_finish_requisition to be able to mock the requests made inside and create a unit test. Refactor requests methods.
…ctoring After the refactoring in #686, this doesn't work anymore: - The API URL didn't end in "/", so the join_url doesn't do correctly the join. - There's an infinite loop when getting the headers for getting the token.
…asic auth If not, there's a loop.
Some of the API endpoints need it, like token renew. You get if not 405 HTTP code. It includes also a typo fix in a method name.
Currently translated at 100.0% (38 of 38 strings) Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_online_gocardless Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_online_gocardless/it/
…ror in wizard new_link method
…d valueDate This fixes behavior when there are debit card transactions with bookingDate behind the actual valueDate. In current situation, this leads to be discarded later in here: https://github.com/OCA/bank-statement-import/blob/e91e28117d5ae3fbb5e1fb168b734f6690689433/account_statement_import_online/models/online_bank_statement_provider.py#L345-L351
… unique transaction identifier
… behavior Correction of the endpoint token/refresh request datas, plus the behavior of the _gocardless_get_token method which in case of a non expired refresh token was calling the endpoint token/new instead of token/refresh.
…mits GoCardless is imposing certain rate limits to their API usage, so we should be aware of them for not having false positives of a query with no activity returned. https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529637772188-Bank-Account-Data-API-Rate-Limits We triggered an exception for interrupting the flow, that serves for both interactive and scheduled download, putting the message in the first case, and logging the exception in the provider chatter in the second, and not advancing in the update interval. Example of the returned message: "The rate limit for this resource is 4/day. Please try again in 85092 seconds" TT56795
On #689, the date selection was flipped arguing that the transactions are discarded for a date interval over the other date. I have checked that when requesting transactions over a period, GoCardless return the transactions based on both dates, so it's not a problem that the transaction is discarded in one round, because in the other it will appear, so we can still use "bookingDate". The problem can be if the booking date is previous to the value date, and the transaction arrives to the bank later. You'll lost it depending on several factors: the download interval, if the transaction is near the interval change. Let's be conservative, keeping the current value, but allowing to select the other date value. TT57550
Currently translated at 100.0% (42 of 42 strings) Translation: bank-statement-import-17.0/bank-statement-import-17.0-account_statement_import_online_gocardless Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_online_gocardless/es/
Currently translated at 100.0% (42 of 42 strings) Translation: bank-statement-import-17.0/bank-statement-import-17.0-account_statement_import_online_gocardless Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-17-0/bank-statement-import-17-0-account_statement_import_online_gocardless/it/
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.
bt_gitbot