From e38e62faff7533506866e7fffb363656f6313d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <30716308+remi-filament@users.noreply.github.com> Date: Wed, 22 May 2024 09:06:02 +0200 Subject: [PATCH] [MIG] account_statement_import_ofx: Migration to 17.0 --- account_statement_import_ofx/__manifest__.py | 4 ++-- .../tests/test_import_bank_statement.py | 20 ++++++++----------- .../account_statement_import.xml | 0 3 files changed, 10 insertions(+), 14 deletions(-) rename account_statement_import_ofx/{views => wizard}/account_statement_import.xml (100%) diff --git a/account_statement_import_ofx/__manifest__.py b/account_statement_import_ofx/__manifest__.py index 77b622e8f..8b215ff77 100644 --- a/account_statement_import_ofx/__manifest__.py +++ b/account_statement_import_ofx/__manifest__.py @@ -1,7 +1,7 @@ { "name": "Import OFX Bank Statement", "category": "Banking addons", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "AGPL-3", "author": "Odoo SA," "Akretion," @@ -14,7 +14,7 @@ "development_status": "Mature", "website": "https://github.com/OCA/bank-statement-import", "depends": ["account_statement_import_file"], - "data": ["views/account_statement_import.xml"], + "data": ["wizard/account_statement_import.xml"], "external_dependencies": {"python": ["ofxparse"]}, "installable": True, } diff --git a/account_statement_import_ofx/tests/test_import_bank_statement.py b/account_statement_import_ofx/tests/test_import_bank_statement.py index c9aed5a46..c275adb78 100644 --- a/account_statement_import_ofx/tests/test_import_bank_statement.py +++ b/account_statement_import_ofx/tests/test_import_bank_statement.py @@ -1,8 +1,8 @@ import base64 import datetime -from odoo.modules.module import get_module_resource from odoo.tests.common import TransactionCase +from odoo.tools.misc import file_path class TestOfxFile(TransactionCase): @@ -11,7 +11,7 @@ class TestOfxFile(TransactionCase): """ def setUp(self): - super(TestOfxFile, self).setUp() + super().setUp() self.asi_model = self.env["account.statement.import"] self.abs_model = self.env["account.bank.statement"] self.j_model = self.env["account.journal"] @@ -56,10 +56,8 @@ def setUp(self): ) def test_wrong_ofx_file_import(self): - ofx_file_path = get_module_resource( - "account_statement_import_ofx", - "tests/test_ofx_file/", - "test_ofx_wrong.ofx", + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx" ) ofx_file_wrong = base64.b64encode(open(ofx_file_path, "rb").read()) bank_statement = self.asi_model.create( @@ -71,8 +69,8 @@ def test_wrong_ofx_file_import(self): self.assertFalse(bank_statement._check_ofx(data_file=ofx_file_wrong)) def test_ofx_file_import(self): - ofx_file_path = get_module_resource( - "account_statement_import_ofx", "tests/test_ofx_file/", "test_ofx.ofx" + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx" ) ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) bank_statement = self.asi_model.create( @@ -95,10 +93,8 @@ def test_ofx_file_import(self): self.assertEqual(line.date, datetime.date(2013, 8, 24)) def test_check_journal_bank_account(self): - ofx_file_path = get_module_resource( - "account_statement_import_ofx", - "tests/test_ofx_file/", - "test_ofx_iban.ofx", + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx" ) ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) bank_st = self.asi_model.create( diff --git a/account_statement_import_ofx/views/account_statement_import.xml b/account_statement_import_ofx/wizard/account_statement_import.xml similarity index 100% rename from account_statement_import_ofx/views/account_statement_import.xml rename to account_statement_import_ofx/wizard/account_statement_import.xml