From ddffa46c631f401ffe85b3340983566ea946f24c Mon Sep 17 00:00:00 2001 From: Carolina Fernandez Date: Mon, 8 Jul 2024 14:03:15 +0200 Subject: [PATCH] [MIG] account_statement_import_online: Migration to 17.0 TT49855 --- account_statement_import_online/README.rst | 4 ++++ account_statement_import_online/__manifest__.py | 3 ++- .../models/online_bank_statement_provider.py | 9 +++++++-- .../readme/CONTRIBUTORS.md | 2 ++ .../static/description/index.html | 15 ++++++++------- .../test_account_bank_statement_import_online.py | 10 ++++------ .../views/account_journal.xml | 12 ++++++------ .../views/online_bank_statement_provider.xml | 4 ++-- test-requirements.txt | 1 + 9 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 test-requirements.txt diff --git a/account_statement_import_online/README.rst b/account_statement_import_online/README.rst index 19d0d1e3..078a12a5 100644 --- a/account_statement_import_online/README.rst +++ b/account_statement_import_online/README.rst @@ -92,6 +92,10 @@ Contributors - Ronald Portier +- `Tecnativa `__: + + - Carolina Fernandez + Maintainers ----------- diff --git a/account_statement_import_online/__manifest__.py b/account_statement_import_online/__manifest__.py index b4359500..17b01ea6 100644 --- a/account_statement_import_online/__manifest__.py +++ b/account_statement_import_online/__manifest__.py @@ -1,11 +1,12 @@ # Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com) # Copyright 2020 CorporateHub (https://corporatehub.eu) # Copyright 2023 Therp BV (https://therp.nl) +# Copyright 2024 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Online Bank Statements", - "version": "16.0.1.2.2", + "version": "17.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 e62e9dfe..417d5e26 100644 --- a/account_statement_import_online/models/online_bank_statement_provider.py +++ b/account_statement_import_online/models/online_bank_statement_provider.py @@ -164,7 +164,12 @@ class OnlineBankStatementProvider(models.Model): def _compute_name(self): """We can have multiple providers/journals for the same service.""" for provider in self: - provider.name = " ".join([provider.journal_id.name, provider.service]) + provider.name = " ".join( + [ + provider.journal_id.name if provider.journal_id else "", + provider.service or "", + ] + ) @api.depends("active", "interval_type", "interval_number") def _compute_update_schedule(self): @@ -289,7 +294,7 @@ class OnlineBankStatementProvider(models.Model): def make_statement_name(self, statement_date_since): """Make name for statement using date and journal name.""" self.ensure_one() - return "%s/%s" % ( + return "{}/{}".format( self.journal_id.code, statement_date_since.strftime("%Y-%m-%d"), ) diff --git a/account_statement_import_online/readme/CONTRIBUTORS.md b/account_statement_import_online/readme/CONTRIBUTORS.md index 55036111..0c9139f2 100644 --- a/account_statement_import_online/readme/CONTRIBUTORS.md +++ b/account_statement_import_online/readme/CONTRIBUTORS.md @@ -2,3 +2,5 @@ - Alexey Pelykh \<\> - [Therp BV](https://therp.nl/) - Ronald Portier \<\> + - [Tecnativa](https://www.tecnativa.com): + - Carolina Fernandez diff --git a/account_statement_import_online/static/description/index.html b/account_statement_import_online/static/description/index.html index 3b4720fd..6263ba47 100644 --- a/account_statement_import_online/static/description/index.html +++ b/account_statement_import_online/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.option { span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -437,14 +436,16 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Ronald Portier <ronald@therp.nl>
  • +
  • Tecnativa:
      +
    • Carolina Fernandez
    • +
    +
  • Maintainers

    This module is maintained by the OCA.

    - -Odoo Community Association - +Odoo Community Association

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    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 26ac1c58..31e3e356 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 @@ -406,13 +406,11 @@ class TestAccountBankAccountStatementImportOnline(common.TransactionCase): ) else: _logger.warning( - _("Names and dates for statements found: %(statements)s"), - dict( - statements=", ".join( - ["%s - %s" % (stmt.name, stmt.date) for stmt in statements] - ) - ), + _("Names and dates for statements found: {}").format( + ", ".join(f"{stmt.name} - {stmt.date}" for stmt in statements) + ) ) + # Now do the normal assert. self.assertEqual(len(statements), expected_length) # If we got expected number, return them. diff --git a/account_statement_import_online/views/account_journal.xml b/account_statement_import_online/views/account_journal.xml index a1fdbd56..73846e86 100644 --- a/account_statement_import_online/views/account_journal.xml +++ b/account_statement_import_online/views/account_journal.xml @@ -19,32 +19,32 @@ name="online_bank_statements" string="Online Bank Statements (OCA)" groups="account.group_account_user" - attrs="{'invisible': [('bank_statements_source', '!=', 'online')]}" + invisible="bank_statements_source != 'online'" >