[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 Ronald Portier (Therp BV)
parent afe43b6331
commit 6cbc21f61b
3 changed files with 11 additions and 13 deletions

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

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