mirror of
				https://github.com/brain-tec/account_ebics.git
				synced 2025-11-02 14:10:58 +00:00 
			
		
		
		
	[13.0]move ebics 2.4 order number generator to ebics_userid
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    'name': 'EBICS banking protocol',
 | 
					    'name': 'EBICS banking protocol',
 | 
				
			||||||
    'version': '13.0.1.1.2',
 | 
					    'version': '13.0.1.1.3',
 | 
				
			||||||
    'license': 'LGPL-3',
 | 
					    'license': 'LGPL-3',
 | 
				
			||||||
    'author': 'Noviat',
 | 
					    'author': 'Noviat',
 | 
				
			||||||
    'website': 'www.noviat.com',
 | 
					    'website': 'www.noviat.com',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,25 +10,6 @@ from odoo.exceptions import UserError
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
_logger = logging.getLogger(__name__)
 | 
					_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):
 | 
					class EbicsConfig(models.Model):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,17 @@ except ImportError:
 | 
				
			|||||||
    _logger.warning('Failed to import fintech')
 | 
					    _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):
 | 
					class EbicsUserID(models.Model):
 | 
				
			||||||
    _name = 'ebics.userid'
 | 
					    _name = 'ebics.userid'
 | 
				
			||||||
    _description = 'EBICS UserID'
 | 
					    _description = 'EBICS UserID'
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user