From 357952d9b4f4ba439c4f7710df13583247e5bc4b Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 19 Jul 2020 11:38:08 +0200 Subject: [PATCH] [13.0][ENH]ebics init_1 extra diagnostics --- account_ebics/__manifest__.py | 2 +- account_ebics/models/ebics_userid.py | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index f447a65..9daf585 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -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', diff --git a/account_ebics/models/ebics_userid.py b/account_ebics/models/ebics_userid.py index efa1044..b273d0e 100644 --- a/account_ebics/models/ebics_userid.py +++ b/account_ebics/models/ebics_userid.py @@ -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:")