From 5971cabc0e8325b0e1829dcda338b64314077d30 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 19 Dec 2016 10:14:20 +0100 Subject: [PATCH 1/2] [9.0][account_financial_report_qweb] Remove ImportError. Yet another violation of https://github.com/OCA/maintainer-quality-tools/pull/354. --- .../report/__init__.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/account_financial_report_qweb/report/__init__.py b/account_financial_report_qweb/report/__init__.py index 111bf4f4..43e54610 100644 --- a/account_financial_report_qweb/report/__init__.py +++ b/account_financial_report_qweb/report/__init__.py @@ -4,12 +4,19 @@ # © 2016 Julien Coux (Camptocamp) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).- -from . import abstract_report_xlsx -from . import aged_partner_balance -from . import aged_partner_balance_xlsx -from . import general_ledger -from . import general_ledger_xlsx -from . import open_items -from . import open_items_xlsx -from . import trial_balance -from . import trial_balance_xlsx +import logging +_logger = logging.getLogger(__name__) +try: + from . import abstract_report_xlsx + from . import aged_partner_balance + from . import aged_partner_balance_xlsx + from . import general_ledger + from . import general_ledger_xlsx + from . import open_items + from . import open_items_xlsx + from . import trial_balance + from . import trial_balance_xlsx +except ImportError: + _logger.info("ImportError raised while loading module.") + _logger.debug("ImportError details:", exc_info=True) + ReportXlsx = object From 82fa8d4d205f60dfad2181799469349a08195b08 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 19 Dec 2016 13:18:59 +0100 Subject: [PATCH 2/2] Only catch ImportError in `*_xslx` modules. --- account_financial_report_qweb/report/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/account_financial_report_qweb/report/__init__.py b/account_financial_report_qweb/report/__init__.py index 43e54610..fb0e633c 100644 --- a/account_financial_report_qweb/report/__init__.py +++ b/account_financial_report_qweb/report/__init__.py @@ -6,17 +6,18 @@ import logging _logger = logging.getLogger(__name__) + +from . import aged_partner_balance +from . import general_ledger +from . import open_items +from . import trial_balance + try: from . import abstract_report_xlsx - from . import aged_partner_balance from . import aged_partner_balance_xlsx - from . import general_ledger from . import general_ledger_xlsx - from . import open_items from . import open_items_xlsx - from . import trial_balance from . import trial_balance_xlsx except ImportError: _logger.info("ImportError raised while loading module.") _logger.debug("ImportError details:", exc_info=True) - ReportXlsx = object