From adc81d9859d92113bff8a68350b3dcb774130887 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Tue, 21 Mar 2017 10:53:14 +0100 Subject: [PATCH] [FIX] Don't break installations that don't have report_xlsx installed Fixes 287 --- account_financial_report_qweb/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/account_financial_report_qweb/__init__.py b/account_financial_report_qweb/__init__.py index 11426ddb..9d797cc2 100644 --- a/account_financial_report_qweb/__init__.py +++ b/account_financial_report_qweb/__init__.py @@ -5,4 +5,15 @@ from . import models from . import wizard -from . import report + +# Don't break installations that don't have this module installed +have_report_xlsx = False +try: + from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx + have_report_xlsx = True +except ImportError: + import logging + logging.getLogger(__name__).warn('Module report_xlsx is not available') + +if have_report_xlsx: + from . import report