From 954d4012f50ef354f738777e3a4bde78d9ae2b5e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 23 Sep 2016 12:29:03 +0200 Subject: [PATCH] [FIX][account_financial_report_qweb] Fix ImportError. It was happening when `xlsxwriter` python module was not available. --- account_financial_report_qweb/README.rst | 1 + account_financial_report_qweb/__init__.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/account_financial_report_qweb/README.rst b/account_financial_report_qweb/README.rst index 443c0fc081a..efe611c36d2 100644 --- a/account_financial_report_qweb/README.rst +++ b/account_financial_report_qweb/README.rst @@ -50,6 +50,7 @@ Contributors * Francesco Apruzzese * Lorenzo Battistini * Julien Coux +* Jairo Llopis Much of the work in this module was done at a sprint in Sorrento, Italy in April 2016. diff --git a/account_financial_report_qweb/__init__.py b/account_financial_report_qweb/__init__.py index 11426ddb47d..3570033484c 100644 --- a/account_financial_report_qweb/__init__.py +++ b/account_financial_report_qweb/__init__.py @@ -2,7 +2,12 @@ # Author: Damien Crier # Copyright 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from . import models -from . import wizard -from . import report +try: + from . import models + from . import wizard + from . import report +except ImportError: + import logging + _logger = logging.getLogger(__name__) + _logger.info("ImportError raised while loading module.") + _logger.debug("ImportError details:", exc_info=True)