From e618566a9911d9c1c6e08dbe0c5b62b9b81aead6 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 22 Jul 2020 15:28:08 +0200 Subject: [PATCH] [13.0]move ebics 2.4 order number generator to ebics_userid --- account_ebics/__manifest__.py | 2 +- account_ebics/models/ebics_config.py | 19 ------------------- account_ebics/models/ebics_userid.py | 11 +++++++++++ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 9daf585..d6467d8 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'EBICS banking protocol', - 'version': '13.0.1.1.2', + 'version': '13.0.1.1.3', 'license': 'LGPL-3', 'author': 'Noviat', 'website': 'www.noviat.com', diff --git a/account_ebics/models/ebics_config.py b/account_ebics/models/ebics_config.py index 051b9df..8c616c7 100644 --- a/account_ebics/models/ebics_config.py +++ b/account_ebics/models/ebics_config.py @@ -10,25 +10,6 @@ from odoo.exceptions import UserError _logger = logging.getLogger(__name__) -try: - import fintech - from fintech.ebics import EbicsBank - fintech.cryptolib = 'cryptography' -except ImportError: - EbicsBank = object - _logger.warning('Failed to import fintech') - - -class EbicsBank(EbicsBank): - - def _next_order_id(self, partnerid): - """ - EBICS protocol version H003 requires generation of the OrderID. - The OrderID must be a string between 'A000' and 'ZZZZ' and - unique for each partner id. - """ - return hasattr(self, '_order_number') and self._order_number or 'A000' - class EbicsConfig(models.Model): """ diff --git a/account_ebics/models/ebics_userid.py b/account_ebics/models/ebics_userid.py index b273d0e..a3bf48f 100644 --- a/account_ebics/models/ebics_userid.py +++ b/account_ebics/models/ebics_userid.py @@ -30,6 +30,17 @@ except ImportError: _logger.warning('Failed to import fintech') +class EbicsBank(EbicsBank): + + def _next_order_id(self, partnerid): + """ + EBICS protocol version H003 requires generation of the OrderID. + The OrderID must be a string between 'A000' and 'ZZZZ' and + unique for each partner id. + """ + return hasattr(self, '_order_number') and self._order_number or 'A000' + + class EbicsUserID(models.Model): _name = 'ebics.userid' _description = 'EBICS UserID'