From b326a1b13e65857563f505ba8e9277d7b7dc5f8a Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 13 Apr 2022 13:09:36 +0200 Subject: [PATCH] [MIG]account_statement_import_online: Migration to 15.0 --- account_statement_import_online/README.rst | 10 +++++----- .../__manifest__.py | 2 +- .../models/online_bank_statement_provider.py | 18 ++++++++---------- .../static/description/index.html | 6 +++--- ...est_account_bank_statement_import_online.py | 4 ++-- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/account_statement_import_online/README.rst b/account_statement_import_online/README.rst index 8eaeca5f..3ab2a5ba 100644 --- a/account_statement_import_online/README.rst +++ b/account_statement_import_online/README.rst @@ -14,13 +14,13 @@ Online Bank Statements :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github - :target: https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online + :target: https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online :alt: OCA/bank-statement-import .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_online + :target: https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_online :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/174/14.0 + :target: https://runbot.odoo-community.org/runbot/174/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -82,7 +82,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -126,6 +126,6 @@ Current `maintainer `__: |maintainer-alexey-pelykh| -This module is part of the `OCA/bank-statement-import `_ project on GitHub. +This module is part of the `OCA/bank-statement-import `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_statement_import_online/__manifest__.py b/account_statement_import_online/__manifest__.py index 8d5f5ad9..a0bc168b 100644 --- a/account_statement_import_online/__manifest__.py +++ b/account_statement_import_online/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Online Bank Statements", - "version": "14.0.3.0.0", + "version": "15.0.1.0.0", "author": "CorporateHub, Odoo Community Association (OCA)", "maintainers": ["alexey-pelykh"], "website": "https://github.com/OCA/bank-statement-import", diff --git a/account_statement_import_online/models/online_bank_statement_provider.py b/account_statement_import_online/models/online_bank_statement_provider.py index 11021f47..64af9344 100644 --- a/account_statement_import_online/models/online_bank_statement_provider.py +++ b/account_statement_import_online/models/online_bank_statement_provider.py @@ -24,7 +24,7 @@ class OnlineBankStatementProvider(models.Model): company_id = fields.Many2one(related="journal_id.company_id", store=True) active = fields.Boolean(default=True) - name = fields.Char(string="Name", compute="_compute_name", store=True) + name = fields.Char(compute="_compute_name", store=True) journal_id = fields.Many2one( comodel_name="account.journal", required=True, @@ -66,7 +66,6 @@ class OnlineBankStatementProvider(models.Model): required=True, ) update_schedule = fields.Char( - string="Update Schedule", compute="_compute_update_schedule", ) last_successful_run = fields.Datetime(string="Last successful pull") @@ -94,7 +93,7 @@ class OnlineBankStatementProvider(models.Model): certificate_public_key = fields.Text() certificate_private_key = fields.Text() certificate_chain = fields.Text() - allow_empty_statements = fields.Boolean(string="Allow empty statements") + allow_empty_statements = fields.Boolean() _sql_constraints = [ ( @@ -172,13 +171,12 @@ class OnlineBankStatementProvider(models.Model): provider.message_post( body=_( "Failed to obtain statement data for period " - "since %s until %s: %s. See server logs for " + "since {since} until {until}: {exception}. See server logs for " "more details." - ) - % ( - statement_date_since, - statement_date_until, - escape(str(e)) or _("N/A"), + ).format( + since=statement_date_since, + until=statement_date_until, + exception=escape(str(e)) or _("N/A"), ), subject=_("Issue with Online Bank Statement Provider"), ) @@ -368,7 +366,7 @@ class OnlineBankStatementProvider(models.Model): "Pulling online bank statements of: %s" % ", ".join(providers.mapped("journal_id.name")) ) - for provider in providers.with_context({"scheduled": True}): + for provider in providers.with_context(**{"scheduled": True}): date_since = ( (provider.last_successful_run) if provider.last_successful_run diff --git a/account_statement_import_online/static/description/index.html b/account_statement_import_online/static/description/index.html index 6a274b09..c47516ea 100644 --- a/account_statement_import_online/static/description/index.html +++ b/account_statement_import_online/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runbot

This module provides base for building online bank statements providers.

Table of contents

@@ -429,7 +429,7 @@ at the provider configuration level.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -462,7 +462,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

alexey-pelykh

-

This module is part of the OCA/bank-statement-import project on GitHub.

+

This module is part of the OCA/bank-statement-import project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/account_statement_import_online/tests/test_account_bank_statement_import_online.py b/account_statement_import_online/tests/test_account_bank_statement_import_online.py index 7d0a5c17..4d7ff23a 100644 --- a/account_statement_import_online/tests/test_account_bank_statement_import_online.py +++ b/account_statement_import_online/tests/test_account_bank_statement_import_online.py @@ -21,7 +21,7 @@ mock_obtain_statement_data = ( ) -class TestAccountBankAccountStatementImportOnline(common.SavepointCase): +class TestAccountBankAccountStatementImportOnline(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() @@ -360,7 +360,7 @@ class TestAccountBankAccountStatementImportOnline(common.SavepointCase): provider.active = True provider.statement_creation_mode = "weekly" - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, "Expected"): provider.with_context(crash=True)._pull( self.now - relativedelta(hours=1), self.now,