[13.0]move ebics 2.4 order number generator to ebics_userid

This commit is contained in:
Luc De Meyer 2020-07-22 15:28:08 +02:00
parent 357952d9b4
commit ba77eb3bea
3 changed files with 12 additions and 20 deletions

View File

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

View File

@ -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):
"""

View File

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