diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py
index 9a5bef2..65003c0 100644
--- a/account_ebics/__manifest__.py
+++ b/account_ebics/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "EBICS banking protocol",
- "version": "16.0.1.5.0",
+ "version": "16.0.1.6.1",
"license": "LGPL-3",
"author": "Noviat",
"website": "https://www.noviat.com/",
diff --git a/account_ebics/models/ebics_file.py b/account_ebics/models/ebics_file.py
index 7ef3514..f27faa3 100644
--- a/account_ebics/models/ebics_file.py
+++ b/account_ebics/models/ebics_file.py
@@ -550,6 +550,11 @@ class EbicsFile(models.Model):
currency_code = stmt.xpath(
"ns:Acct/ns:Ccy/text() | ns:Bal/ns:Amt/@Ccy", namespaces=ns
)[0]
+ # some banks (e.g. COMMERZBANK) add the currency as the last 3 digits
+ # of the bank account number hence we need to remove this since otherwise
+ # the journal matching logic fails
+ if acc_number[-3:] == currency_code:
+ acc_number = acc_number[:-3]
root_new = deepcopy(root)
entries = False
diff --git a/account_ebics/models/ebics_userid.py b/account_ebics/models/ebics_userid.py
index 64d47c4..ef2dc13 100644
--- a/account_ebics/models/ebics_userid.py
+++ b/account_ebics/models/ebics_userid.py
@@ -109,6 +109,12 @@ class EbicsUserID(models.Model):
"passphrase for every EBICS transaction, hence do not uncheck this "
"option on a userid for automated EBICS downloads.",
)
+ ebics_passphrase_required = fields.Boolean(
+ compute="_compute_ebics_passphrase_view_modifiers"
+ )
+ ebics_passphrase_invisible = fields.Boolean(
+ compute="_compute_ebics_passphrase_view_modifiers"
+ )
ebics_ini_letter = fields.Binary(
string="EBICS INI Letter",
readonly=True,
@@ -208,6 +214,19 @@ class EbicsUserID(models.Model):
rec.ebics_keys_fn
)
+ @api.depends("state", "ebics_passphrase")
+ def _compute_ebics_passphrase_view_modifiers(self):
+ for rec in self:
+ if rec.state == "draft":
+ rec.ebics_passphrase_required = True
+ rec.ebics_passphrase_invisible = False
+ elif rec.state == "get_bank_keys":
+ rec.ebics_passphrase_required = not rec.ebics_passphrase
+ rec.ebics_passphrase_invisible = rec.ebics_passphrase
+ else:
+ rec.ebics_passphrase_required = False
+ rec.ebics_passphrase_invisible = True
+
@api.constrains("ebics_key_x509")
def _check_ebics_key_x509(self):
for cfg in self:
@@ -247,6 +266,14 @@ class EbicsUserID(models.Model):
return self.write({"state": "active_keys"})
def set_to_get_bank_keys(self):
+ self.ensure_one()
+ if self.ebics_config_id.state != "draft":
+ raise UserError(
+ _(
+ "Set the EBICS Configuation record to 'Draft' "
+ "before starting the Key Renewal process."
+ )
+ )
return self.write({"state": "get_bank_keys"})
def ebics_init_1(self): # noqa: C901
diff --git a/account_ebics/views/ebics_userid_views.xml b/account_ebics/views/ebics_userid_views.xml
index afe3088..e4d9fd5 100644
--- a/account_ebics/views/ebics_userid_views.xml
+++ b/account_ebics/views/ebics_userid_views.xml
@@ -57,7 +57,7 @@
string="Change Passphrase"
type="object"
class="oe_highlight"
- attrs="{'invisible': [('ebics_keys_found', '=', False)]}"
+ attrs="{'invisible': ['|', ('ebics_keys_found', '=', False), ('state', '!=', 'active_keys')]}"
/>
+
+
diff --git a/account_ebics_oca_statement_import/__manifest__.py b/account_ebics_oca_statement_import/__manifest__.py
index afbca14..321f257 100644
--- a/account_ebics_oca_statement_import/__manifest__.py
+++ b/account_ebics_oca_statement_import/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "account_ebics with OCA Bank Statement Imoort",
"summary": "Use OCA Bank Statement Import with account_ebics",
- "version": "16.0.1.0.1",
+ "version": "16.0.1.0.2",
"author": "Noviat",
"website": "https://www.noviat.com/",
"category": "Hidden",
diff --git a/account_ebics_oca_statement_import/wizards/account_statement_import.py b/account_ebics_oca_statement_import/wizards/account_statement_import.py
index 819cd02..dc33a96 100644
--- a/account_ebics_oca_statement_import/wizards/account_statement_import.py
+++ b/account_ebics_oca_statement_import/wizards/account_statement_import.py
@@ -46,7 +46,9 @@ class AccountStatementImport(models.TransientModel):
We could also create empty bank statement (in state done) to clearly
show days without transactions via the bank statement list view.
"""
- if self.env.context.get("active_model") == "ebics.file":
+ if self.env.context.get("active_model") != "ebics.file":
+ return super()._create_bank_statements(stmts_vals, result)
+ else:
messages = []
transactions = False
for st_vals in stmts_vals: