From f2703358ef975806a312bdf1083aa2d8eea9ec78 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Fri, 1 Dec 2023 18:53:54 +0100 Subject: [PATCH] [IMP]add support for fintech 7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In fintech 7.4 EbicsUser.manual_approval has been replaced by class parameter “transport_only”. The account_ebics code has now been adapted to support fintech >=7.4 as well as older releases. --- account_ebics/__manifest__.py | 2 +- account_ebics/wizards/ebics_xfer.py | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 65003c0..aa0643b 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,7 @@ { "name": "EBICS banking protocol", - "version": "16.0.1.6.1", + "version": "16.0.1.6.2", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", diff --git a/account_ebics/wizards/ebics_xfer.py b/account_ebics/wizards/ebics_xfer.py index 744c0d4..bfa4b74 100644 --- a/account_ebics/wizards/ebics_xfer.py +++ b/account_ebics/wizards/ebics_xfer.py @@ -462,12 +462,21 @@ class EbicsXfer(models.TransientModel): if self.ebics_config_id.ebics_version == "H003": bank._order_number = self.ebics_config_id._get_order_number() + signature_class = ( + self.format_id.signature_class or self.ebics_userid_id.signature_class + ) + + user_params = { + "keyring": keyring, + "partnerid": self.ebics_config_id.ebics_partner, + "userid": self.ebics_userid_id.name, + } + # manual_approval replaced by transport_only class param in fintech 7.4 + fintech74 = hasattr(EbicsUser, "transport_only") + if fintech74: + user_params["transport_only"] = signature_class == "T" and True or False try: - user = EbicsUser( - keyring=keyring, - partnerid=self.ebics_config_id.ebics_partner, - userid=self.ebics_userid_id.name, - ) + user = EbicsUser(**user_params) except ValueError as err: error = _("Error while accessing the EBICS UserID:") error += "\n" @@ -477,11 +486,8 @@ class EbicsXfer(models.TransientModel): error += "\n" error += _("Doublecheck your EBICS Passphrase and UserID settings.") raise UserError(error) from err - - signature_class = ( - self.format_id.signature_class or self.ebics_userid_id.signature_class - ) - if signature_class == "T": + # manual_approval replaced by transport_only class param in fintech 7.4 + if not fintech74 and signature_class == "T": user.manual_approval = True try: