From b3d2d394141f492fb4b06d58809b50413e64033a Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 13 Apr 2022 14:03:04 +0200 Subject: [PATCH] [MIG]account_statement_import_online_ponto: Migration to 15.0 --- .../__manifest__.py | 2 +- .../online_bank_statement_provider_ponto.py | 16 ++++++++++------ ...test_account_statement_import_online_ponto.py | 2 ++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/account_statement_import_online_ponto/__manifest__.py b/account_statement_import_online_ponto/__manifest__.py index 1a3aabff..cc8d5499 100644 --- a/account_statement_import_online_ponto/__manifest__.py +++ b/account_statement_import_online_ponto/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Online Bank Statements: MyPonto.com", - "version": "14.0.1.1.0", + "version": "15.0.1.0.0", "category": "Account", "website": "https://github.com/OCA/bank-statement-import", "author": "Florent de Labarre, Odoo Community Association (OCA)", diff --git a/account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py b/account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py index b962ae96..d281dd06 100644 --- a/account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py +++ b/account_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py @@ -83,7 +83,9 @@ class OnlineBankStatementProviderPonto(models.Model): ) self.sudo().ponto_token_expiration = expiration_date else: - raise UserError(_("%s \n\n %s") % (response.status_code, response.text)) + raise UserError( + _("{} \n\n {}").format(response.status_code, response.text) + ) return { "Accept": "application/json", "Authorization": "Bearer %s" % self.ponto_token, @@ -103,7 +105,7 @@ class OnlineBankStatementProviderPonto(models.Model): ) res[iban] = account.get("id") return res - raise UserError(_("%s \n\n %s") % (response.status_code, response.text)) + raise UserError(_("{} \n\n {}").format(response.status_code, response.text)) def _ponto_synchronisation(self, account_id): url = PONTO_ENDPOINT + "/synchronizations" @@ -123,8 +125,9 @@ class OnlineBankStatementProviderPonto(models.Model): sync_id = data.get("attributes", {}).get("resourceId", False) else: raise UserError( - _("Error during Create Synchronisation %s \n\n %s") - % (response.status_code, response.text) + _("Error during Create Synchronisation {} \n\n {}").format( + response.status_code, response.text + ) ) # Check synchronisation @@ -158,8 +161,9 @@ class OnlineBankStatementProviderPonto(models.Model): ) if response.status_code != 200: raise UserError( - _("Error during get transaction.\n\n%s \n\n %s") - % (response.status_code, response.text) + _("Error during get transaction.\n\n{} \n\n {}").format( + response.status_code, response.text + ) ) if params.get("before"): params.pop("before") diff --git a/account_statement_import_online_ponto/tests/test_account_statement_import_online_ponto.py b/account_statement_import_online_ponto/tests/test_account_statement_import_online_ponto.py index 31660696..6165c693 100644 --- a/account_statement_import_online_ponto/tests/test_account_statement_import_online_ponto.py +++ b/account_statement_import_online_ponto/tests/test_account_statement_import_online_ponto.py @@ -29,6 +29,8 @@ class TestAccountBankAccountStatementImportOnlineQonto(common.TransactionCase): self.AccountBankStatementLine = self.env["account.bank.statement.line"] self.AccStatemenPull = self.env["online.bank.statement.pull.wizard"] + self.currency_eur.write({"active": True}) + self.bank_account = self.ResPartnerBank.create( { "acc_number": "FR0214508000302245362775K46",