diff --git a/account_payment_return_import/README.rst b/account_payment_return_import/README.rst index e81ad4b310d3..017d252b4992 100644 --- a/account_payment_return_import/README.rst +++ b/account_payment_return_import/README.rst @@ -10,9 +10,9 @@ Account Payment Return Import !! source digest: sha256:59ba0330c4a2226f8b777e3827942848bbb5f0e29445c7bf13efdf2a8248e26b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status - :alt: Mature + :alt: Production/Stable .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 @@ -91,6 +91,7 @@ Contributors - Luis M. Ontalba - Ernesto Tejeda - Yadier Quesada + - Carolina Fernandez Maintainers ----------- diff --git a/account_payment_return_import/__manifest__.py b/account_payment_return_import/__manifest__.py index fad1419614aa..adb12daee3ba 100644 --- a/account_payment_return_import/__manifest__.py +++ b/account_payment_return_import/__manifest__.py @@ -1,13 +1,14 @@ # Copyright 2016 Tecnativa - Carlos Dauden # Copyright 2016-2020 Tecnativa - Pedro M. Baeza # Copyright 2017 Tecnativa - David Vidal +# Copyright 2024 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Account Payment Return Import", "category": "Accounting", - "version": "16.0.1.0.1", - "development_status": "Mature", + "version": "17.0.1.0.0", + "development_status": "Production/Stable", "summary": "This module adds a generic wizard to import payment return" "file formats. Is only the base to be extended by another" "modules", diff --git a/account_payment_return_import/readme/CONTRIBUTORS.md b/account_payment_return_import/readme/CONTRIBUTORS.md index 7d4629620226..a8d172400954 100644 --- a/account_payment_return_import/readme/CONTRIBUTORS.md +++ b/account_payment_return_import/readme/CONTRIBUTORS.md @@ -6,3 +6,4 @@ - Luis M. Ontalba - Ernesto Tejeda - Yadier Quesada + - Carolina Fernandez diff --git a/account_payment_return_import/static/description/index.html b/account_payment_return_import/static/description/index.html index 784a7ebf61f6..2e4f9f46830a 100644 --- a/account_payment_return_import/static/description/index.html +++ b/account_payment_return_import/static/description/index.html @@ -368,7 +368,7 @@

Account Payment Return Import

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:59ba0330c4a2226f8b777e3827942848bbb5f0e29445c7bf13efdf2a8248e26b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Mature License: AGPL-3 OCA/account-payment Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/account-payment Translate me on Weblate Try me on Runboat

This module adds a generic wizard + methods to import payment return file formats.

It’s a base to be extended by another modules though it allows to import @@ -432,6 +432,7 @@

Contributors

  • Luis M. Ontalba
  • Ernesto Tejeda
  • Yadier Quesada
  • +
  • Carolina Fernandez
  • diff --git a/account_payment_return_import/tests/test_import_base.py b/account_payment_return_import/tests/test_import_base.py index 57eebec62dfc..dd99a9552017 100644 --- a/account_payment_return_import/tests/test_import_base.py +++ b/account_payment_return_import/tests/test_import_base.py @@ -14,16 +14,6 @@ class TestImportBase(TestPaymentReturnFile): @classmethod def setUpClass(cls): super().setUpClass() - cls.env = cls.env( - context=dict( - cls.env.context, - mail_create_nolog=True, - mail_create_nosubscribe=True, - mail_notrack=True, - no_reset_password=True, - tracking_disable=True, - ) - ) cls.company = cls.env.ref("base.main_company") cls.acc_number = "NL77ABNA0574908765" cls.acc_bank = cls.env["res.partner.bank"].create( diff --git a/account_payment_return_import/tests/test_import_file.py b/account_payment_return_import/tests/test_import_file.py index 92a79003d60e..3756f92ccf26 100644 --- a/account_payment_return_import/tests/test_import_file.py +++ b/account_payment_return_import/tests/test_import_file.py @@ -1,18 +1,20 @@ # Copyright 2016 Tecnativa - Carlos Dauden # Copyright 2018 Tecnativa - Luis M. Ontalba +# Copyright 2024 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import base64 import logging from odoo import fields -from odoo.modules.module import get_module_resource -from odoo.tests.common import TransactionCase +from odoo.tools.misc import file_open, file_path + +from odoo.addons.base.tests.common import BaseCommon _logger = logging.getLogger(__name__) -class TestPaymentReturnFile(TransactionCase): +class TestPaymentReturnFile(BaseCommon): """Check whether payment returns with transactions correctly imported. No actual tests are done in this class, implementations are in @@ -22,16 +24,6 @@ class TestPaymentReturnFile(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() - cls.env = cls.env( - context=dict( - cls.env.context, - mail_create_nolog=True, - mail_create_nosubscribe=True, - mail_notrack=True, - no_reset_password=True, - tracking_disable=True, - ) - ) def _test_transaction( self, return_obj, reference=False, returned_amount=False, reason_add_info=False @@ -74,8 +66,8 @@ def _test_return_import( """Test correct creation of single return.""" import_model = self.env["payment.return.import"] return_model = self.env["payment.return"] - return_path = get_module_resource(module_name, "tests", "test_files", file_name) - return_file = base64.b64encode(open(return_path, "rb").read()) + return_path = file_path(module_name + "/tests/test_files/" + file_name) + return_file = base64.b64encode(file_open(return_path, "rb").read()) bank_return_id = import_model.create( dict( data_file=return_file, @@ -95,8 +87,8 @@ def _test_return_import( self.assertEqual( fields.Date.to_string(return_obj.date), date, - "Date %s not equal to expected %s" - % (fields.Date.to_string(return_obj.date), date), + f"Date {fields.Date.to_string(return_obj.date)}\ + not equal to expected {date}", ) if transactions: for transaction in transactions: diff --git a/account_payment_return_import/tests/test_import_payment_return.py b/account_payment_return_import/tests/test_import_payment_return.py index 21d1f2fd8e1a..d3c81ae371ff 100644 --- a/account_payment_return_import/tests/test_import_payment_return.py +++ b/account_payment_return_import/tests/test_import_payment_return.py @@ -1,23 +1,13 @@ # Copyright 2016 Tecnativa - Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests.common import TransactionCase +from odoo.addons.base.tests.common import BaseCommon -class TestAccountPaymentReturnImport(TransactionCase): +class TestAccountPaymentReturnImport(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() - cls.env = cls.env( - context=dict( - cls.env.context, - mail_create_nolog=True, - mail_create_nosubscribe=True, - mail_notrack=True, - no_reset_password=True, - tracking_disable=True, - ) - ) cls.return_import_model = cls.env["payment.return.import"] cls.company = cls.env.ref("base.main_company") cls.acc_number = "NL77ABNA0574908765" diff --git a/account_payment_return_import/views/payment_return_view.xml b/account_payment_return_import/views/payment_return_view.xml index 176fb85d2f52..f55f6a62792a 100644 --- a/account_payment_return_import/views/payment_return_view.xml +++ b/account_payment_return_import/views/payment_return_view.xml @@ -18,7 +18,7 @@ diff --git a/account_payment_return_import/wizard/payment_return_import_view.xml b/account_payment_return_import/wizard/payment_return_import_view.xml index c8ee97ea7144..7a5ee0282db7 100644 --- a/account_payment_return_import/wizard/payment_return_import_view.xml +++ b/account_payment_return_import/wizard/payment_return_import_view.xml @@ -22,7 +22,7 @@