Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] account_statement_import_online_gocardless #751

Merged
merged 38 commits into from
Jan 19, 2025

Conversation

etobella
Copy link
Member

Migration of JS

@etobella
Copy link
Member Author

/ocabot migration account_statement_import_online_gocardless

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Dec 17, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Dec 17, 2024
12 tasks
Copy link

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following error when i try to type into gocardless selection wizard.

TypeError: institutions.filter is not a function at GocardlessDialog.get_institutions (http://oca-bank-statement-import-17-0-pr751-2b072a4706f9.runboat.odoo-community.org/web/assets/2aef316/web.assets_web.min.js:15458:114) at GocardlessDialog.onInstitutionSearch (http://oca-bank-statement-import-17-0-pr751-2b072a4706f9.runboat.odoo-community.org/web/assets/2aef316/web.assets_web.min.js:15457:130) at Object.mainEventHandler (http://oca-bank-statement-import-17-0-pr751-2b072a4706f9.runboat.odoo-community.org/web/assets/2aef316/web.assets_web.min.js:1567:77) at HTMLInputElement.listener (http://oca-bank-statement-import-17-0-pr751-2b072a4706f9.runboat.odoo-community.org/web/assets/2aef316/web.assets_web.min.js:726:15)

What am I doing wrong?

@etobella
Copy link
Member Author

etobella commented Jan 8, 2025

Do you have a company selected?

@etobella
Copy link
Member Author

etobella commented Jan 8, 2025

Well, the problem might be that you don't have the API keys

Copy link

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@pedrobaeza
Copy link
Member

Everything seems correct. One little detail about the button not being showed nicely:

imagen

pedrobaeza and others added 22 commits January 19, 2025 22:08
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 <[email protected]>
Co-Authored-By: Jordi Ballester <[email protected]>
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 26.0% (6 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/
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
mymage and others added 16 commits January 19, 2025 22:08
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 OCA#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/
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/
@etobella
Copy link
Member Author

@pedrobaeza Should be fxed now.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-751-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at ae4e85a. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit 278ff3a into OCA:17.0 Jan 19, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants