[MIG] account_statement_import_online: Migration to 17.0

TT49855
This commit is contained in:
Carolina Fernandez
2024-07-08 14:03:15 +02:00
parent 0eddd6cfb9
commit ddffa46c63
9 changed files with 36 additions and 24 deletions

View File

@@ -92,6 +92,10 @@ Contributors
- Ronald Portier <ronald@therp.nl>
- `Tecnativa <https://www.tecnativa.com>`__:
- Carolina Fernandez
Maintainers
-----------

View File

@@ -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",

View File

@@ -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"),
)

View File

@@ -2,3 +2,5 @@
- Alexey Pelykh \<<alexey.pelykh@corphub.eu>\>
- [Therp BV](https://therp.nl/)
- Ronald Portier \<<ronald@therp.nl>\>
- [Tecnativa](https://www.tecnativa.com):
- Carolina Fernandez

View File

@@ -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
<li>Ronald Portier &lt;<a class="reference external" href="mailto:ronald&#64;therp.nl">ronald&#64;therp.nl</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Carolina Fernandez</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>

View File

@@ -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.

View File

@@ -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'"
>
<label
for="online_bank_statement_provider"
string="Provider"
attrs="{'required': [('bank_statements_source', '=', 'online')]}"
required="bank_statements_source == 'online'"
class="oe_edit_only"
groups="account.group_account_user"
/>
<field
name="online_bank_statement_provider"
nolabel="1"
attrs="{'required': [('bank_statements_source', '=', 'online')]}"
required="bank_statements_source == 'online'"
class="oe_edit_only"
groups="account.group_account_user"
/>
<label
for="online_bank_statement_provider_id"
string="Provider"
attrs="{'invisible': [('online_bank_statement_provider_id', '=', False)]}"
invisible="not online_bank_statement_provider_id"
class="oe_read_only"
/>
<field
name="online_bank_statement_provider_id"
nolabel="1"
attrs="{'invisible': [('online_bank_statement_provider_id', '=', False)]}"
invisible="not online_bank_statement_provider_id"
class="oe_read_only"
/>
</group>
@@ -53,7 +53,7 @@
<button
type="action"
name="%(action_online_bank_statements_pull_wizard)d"
attrs="{'invisible': [('bank_statements_source', '!=', 'online')]}"
invisible="bank_statements_source != 'online'"
string="Pull Online Bank Statement"
groups="account.group_account_user"
/>

View File

@@ -51,7 +51,7 @@
<button
type="action"
name="%(action_online_bank_statements_pull_wizard)d"
attrs="{'invisible': [('active', '=', False)]}"
invisible="not active"
string="Pull Online Bank Statement"
/>
</header>
@@ -60,7 +60,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<group name="main" col="2">
<group name="params">

1
test-requirements.txt Normal file
View File

@@ -0,0 +1 @@
odoo-test-helper