Skip to content

Syncing from upstream OCA/bank-statement-import (19.0) - #785

Merged
bt-admin merged 37 commits into
brain-tec:19.0from
OCA:19.0
Aug 25, 2026
Merged

Syncing from upstream OCA/bank-statement-import (19.0)#785
bt-admin merged 37 commits into
brain-tec:19.0from
OCA:19.0

Conversation

@bt-admin

Copy link
Copy Markdown

bt_gitbot

pedrobaeza and others added 30 commits August 4, 2026 14:04
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
…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.
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/
…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
… 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/
@bt-admin bt-admin added the 19.0 label Aug 25, 2026
@bt-admin
bt-admin merged commit 82eb3cc into brain-tec:19.0 Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.