[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> - Ronald Portier <ronald@therp.nl>
- `Tecnativa <https://www.tecnativa.com>`__:
- Carolina Fernandez
Maintainers Maintainers
----------- -----------

View File

@@ -1,11 +1,12 @@
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com) # Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2020 CorporateHub (https://corporatehub.eu) # Copyright 2020 CorporateHub (https://corporatehub.eu)
# Copyright 2023 Therp BV (https://therp.nl) # Copyright 2023 Therp BV (https://therp.nl)
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{ {
"name": "Online Bank Statements", "name": "Online Bank Statements",
"version": "16.0.1.2.2", "version": "17.0.1.0.0",
"author": "CorporateHub, Odoo Community Association (OCA)", "author": "CorporateHub, Odoo Community Association (OCA)",
"maintainers": ["alexey-pelykh"], "maintainers": ["alexey-pelykh"],
"website": "https://github.com/OCA/bank-statement-import", "website": "https://github.com/OCA/bank-statement-import",

View File

@@ -164,7 +164,12 @@ class OnlineBankStatementProvider(models.Model):
def _compute_name(self): def _compute_name(self):
"""We can have multiple providers/journals for the same service.""" """We can have multiple providers/journals for the same service."""
for provider in self: 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") @api.depends("active", "interval_type", "interval_number")
def _compute_update_schedule(self): def _compute_update_schedule(self):
@@ -289,7 +294,7 @@ class OnlineBankStatementProvider(models.Model):
def make_statement_name(self, statement_date_since): def make_statement_name(self, statement_date_since):
"""Make name for statement using date and journal name.""" """Make name for statement using date and journal name."""
self.ensure_one() self.ensure_one()
return "%s/%s" % ( return "{}/{}".format(
self.journal_id.code, self.journal_id.code,
statement_date_since.strftime("%Y-%m-%d"), statement_date_since.strftime("%Y-%m-%d"),
) )

View File

@@ -2,3 +2,5 @@
- Alexey Pelykh \<<alexey.pelykh@corphub.eu>\> - Alexey Pelykh \<<alexey.pelykh@corphub.eu>\>
- [Therp BV](https://therp.nl/) - [Therp BV](https://therp.nl/)
- Ronald Portier \<<ronald@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) :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. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
@@ -275,7 +274,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 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, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic, pre.problematic { span.problematic {
color: red } color: red }
span.section-subtitle { 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> <li>Ronald Portier &lt;<a class="reference external" href="mailto:ronald&#64;therp.nl">ronald&#64;therp.nl</a>&gt;</li>
</ul> </ul>
</li> </li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Carolina Fernandez</li>
</ul>
</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2> <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>

View File

@@ -406,13 +406,11 @@ class TestAccountBankAccountStatementImportOnline(common.TransactionCase):
) )
else: else:
_logger.warning( _logger.warning(
_("Names and dates for statements found: %(statements)s"), _("Names and dates for statements found: {}").format(
dict( ", ".join(f"{stmt.name} - {stmt.date}" for stmt in statements)
statements=", ".join( )
["%s - %s" % (stmt.name, stmt.date) for stmt in statements]
)
),
) )
# Now do the normal assert. # Now do the normal assert.
self.assertEqual(len(statements), expected_length) self.assertEqual(len(statements), expected_length)
# If we got expected number, return them. # If we got expected number, return them.

View File

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

View File

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

1
test-requirements.txt Normal file
View File

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