[13.0][ENH]ebics init_1 extra diagnostics

This commit is contained in:
Luc De Meyer 2020-07-19 11:38:08 +02:00
parent c1275132aa
commit 9d277b3217
2 changed files with 17 additions and 3 deletions

View File

@ -3,7 +3,7 @@
{
'name': 'EBICS banking protocol',
'version': '13.0.1.1.1',
'version': '13.0.1.1.2',
'license': 'LGPL-3',
'author': 'Noviat',
'website': 'www.noviat.com',

View File

@ -5,6 +5,7 @@ import base64
import logging
import os
from sys import exc_info
from traceback import format_exception
from urllib.error import URLError
from odoo import _, api, fields, models
@ -12,6 +13,14 @@ from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
"""
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s] %(levelname)s - %(name)s: %(message)s')
"""
try:
import fintech
from fintech.ebics import EbicsKeyRing, EbicsBank, EbicsUser,\
@ -171,7 +180,6 @@ class EbicsUserID(models.Model):
if not self.ebics_passphrase:
raise UserError(
_("Set a passphrase."))
try:
keyring = EbicsKeyRing(
keys=self.ebics_keys_fn,
@ -229,9 +237,15 @@ class EbicsUserID(models.Model):
self.ebics_config_id._update_order_number(OrderID)
except URLError:
exctype, value = exc_info()[:2]
tb = "".join(format_exception(*exc_info()))
_logger.error(
"EBICS INI command error\nUserID: %s\n%s",
self.name,
tb,
)
raise UserError(_(
"urlopen error:\n url '%s' - %s")
% (self.ebics_url, str(value)))
% (self.ebics_config_id.ebics_url, str(value)))
except EbicsFunctionalError:
e = exc_info()
error = _("EBICS Functional Error:")