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_ofx #695

Open
wants to merge 24 commits into
base: 17.0
Choose a base branch
from

Conversation

remi-filament
Copy link
Contributor

No description provided.

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 22, 2024
@remi-filament remi-filament force-pushed the 17.0-mig-account_statement_import_ofx branch from 220aa7f to d69bebe Compare September 24, 2024 09:14
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 29, 2024
@rrebollo
Copy link

rrebollo commented Dec 3, 2024

@remi-filament hello, thanks for your contribution. Is there anything I could do to move this forward? Maybe can I take it from here?

@remi-filament
Copy link
Contributor Author

Hi @rrebollo I am not sure what you mean ?
From my point of view nothing is missing here, except approval and merge, so to move forward you can review it and approve.
Thanks !

@rrebollo
Copy link

rrebollo commented Dec 5, 2024

Great @remi-filament, I'll do a code review but in order to have a runboat instance U need all tests in green.

Copy link

@rrebollo rrebollo left a comment

Choose a reason for hiding this comment

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

Code review LGTM, nevertheless I think tests rewriting to fit the setUpClass approach would be great.

Copy link

Choose a reason for hiding this comment

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

It would be great to translate these tests to the "new" setUpClass approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am afraid I have no idea what you mean...
Any pointer would be highly appreciated !
Thanks

Copy link

Choose a reason for hiding this comment

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

Sure! Let me start by making it clear: the current implementation works perfectly fine, but I believe there’s room for improvement. This is a desirable enhancement, not a mandatory one.

I’m not an expert in Odoo’s test framework, but I came across this topic through the following reference:
OCA Maintainer Tools - Migration to version 15.0.

One recommendation is:

If there's a test class using setUp to generate test records, consider moving it to setUpClass for better performance, as it runs only once.

I’ve applied this approach during migrations and found it beneficial. For example, here’s a case from the OCA repositories (not authored by me):

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.eur_currency = cls.env["res.currency"].search(
[("name", "=", "EUR"), ("active", "=", False)], limit=1
)
cls.eur_currency.write({"active": True})
cls.bank_account = cls.env["res.partner.bank"].create(
{"acc_number": "1111111111", "partner_id": cls.env.company.partner_id.id}
)
cls.bank_account_2 = cls.env["res.partner.bank"].create(
{"acc_number": "3333333333", "partner_id": cls.env.company.partner_id.id}
)
cls.journal_1 = cls.env["account.journal"].create(
{
"name": "Test asset journal-1",
"code": "AST-1",
"type": "bank",
"bank_account_id": cls.bank_account.id,
}
)
cls.journal_2 = cls.env["account.journal"].create(
{
"name": "Test asset journal-2",
"code": "AST-2",
"type": "bank",
"bank_account_id": cls.bank_account.id,
}
)
f_path = file_path("account_statement_import_file/tests/test_file.txt")
file = base64.b64encode(open(f_path, "rb").read())
cls.import_wizard = (
cls.env["account.statement.import"]
.with_context(journal_id=cls.journal_1.id)
.create({"statement_file": file, "statement_filename": "Test"})
)

This demonstrates how some refactoring can replace setUp with setUpClass. You can infer the "rules of the game" directly from the code or conduct your own research on the topic to implement similar improvements.

Thanks again for considering this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the links, that was easy, I just force pushed with the update of test class.

alexis-via and others added 21 commits December 6, 2024 07:40
Rename module to account_statement_import_ofx
Add support for multi-account OFX files
Currently translated at 57.1% (4 of 7 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_ofx/fr/
Currently translated at 57.1% (4 of 7 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_ofx/fr_FR/
Currently translated at 71.4% (5 of 7 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_ofx/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: bank-statement-import-14.0/bank-statement-import-14.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_ofx/es_AR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/
Currently translated at 100.0% (7 of 7 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/es/
Currently translated at 100.0% (4 of 4 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/fr/
Currently translated at 100.0% (4 of 4 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/
Currently translated at 100.0% (4 of 4 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/pt_BR/
Currently translated at 75.0% (3 of 4 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/it/
mymage and others added 2 commits December 6, 2024 07:40
Currently translated at 100.0% (4 of 4 strings)

Translation: bank-statement-import-16.0/bank-statement-import-16.0-account_statement_import_ofx
Translate-URL: https://translation.odoo-community.org/projects/bank-statement-import-16-0/bank-statement-import-16-0-account_statement_import_ofx/it/
@remi-filament remi-filament force-pushed the 17.0-mig-account_statement_import_ofx branch from d69bebe to e38e62f Compare December 6, 2024 06:40
@remi-filament
Copy link
Contributor Author

Great @remi-filament, I'll do a code review but in order to have a runboat instance U need all tests in green.

Thanks, runboat does not need code coverage tests to be green, but for some reason it was not completed. Anyhow I rebased on branch 17.0 and force pushed to get it back.

@remi-filament remi-filament force-pushed the 17.0-mig-account_statement_import_ofx branch from e38e62f to c5c9704 Compare December 9, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.