[MIG]account_statement_import_online: Migration to 15.0

This commit is contained in:
manu
2022-04-13 13:09:36 +02:00
committed by Carolina Fernandez
parent 1f28d915a7
commit b326a1b13e
5 changed files with 19 additions and 21 deletions

View File

@@ -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 <https://github.com/OCA/bank-statement-import/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 <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -126,6 +126,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-alexey-pelykh|
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online>`_ project on GitHub.
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

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

View File

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

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_online"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/174/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-15-0/bank-statement-import-15-0-account_statement_import_online"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/174/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module provides base for building online bank statements providers.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
@@ -429,7 +429,7 @@ at the provider configuration level.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-statement-import/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_statement_import_online%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -462,7 +462,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/alexey-pelykh"><img alt="alexey-pelykh" src="https://github.com/alexey-pelykh.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_online">OCA/bank-statement-import</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/15.0/account_statement_import_online">OCA/bank-statement-import</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

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