From 8d637a5f8025d37df07e37d3caf4a7aa59e4cdce Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Jan 2014 12:34:28 +0100 Subject: [PATCH 1/2] [FIX] crash if this branch is in addons path but report_xls is not available --- account_financial_report_webkit_xls/__init__.py | 7 ++++++- account_move_line_report_xls/__init__.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit_xls/__init__.py b/account_financial_report_webkit_xls/__init__.py index d96f4819..db43eacb 100644 --- a/account_financial_report_webkit_xls/__init__.py +++ b/account_financial_report_webkit_xls/__init__.py @@ -21,4 +21,9 @@ ############################################################################## from . import wizard -from . import report +try: + from . import report +except ImportError: + import logging + logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable') + diff --git a/account_move_line_report_xls/__init__.py b/account_move_line_report_xls/__init__.py index 728de535..75e3e519 100644 --- a/account_move_line_report_xls/__init__.py +++ b/account_move_line_report_xls/__init__.py @@ -21,4 +21,9 @@ ############################################################################## from . import account_move_line -from . import report +try: + from . import report +except ImportError: + import logging + logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable') + From b8ad60e99de765e5ec1f0f7916efe443ff2137e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Jan 2014 12:49:48 +0100 Subject: [PATCH 2/2] fix the fix --- account_financial_report_webkit_xls/__init__.py | 2 +- account_journal_report_xls/__init__.py | 12 +++++++++--- account_move_line_report_xls/__init__.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/account_financial_report_webkit_xls/__init__.py b/account_financial_report_webkit_xls/__init__.py index db43eacb..1dc88c87 100644 --- a/account_financial_report_webkit_xls/__init__.py +++ b/account_financial_report_webkit_xls/__init__.py @@ -20,8 +20,8 @@ # ############################################################################## -from . import wizard try: + from . import wizard from . import report except ImportError: import logging diff --git a/account_journal_report_xls/__init__.py b/account_journal_report_xls/__init__.py index 87345508..d05eff46 100644 --- a/account_journal_report_xls/__init__.py +++ b/account_journal_report_xls/__init__.py @@ -20,8 +20,14 @@ # ############################################################################## -from . import account_journal -from . import wizard -from . import report +try: + from . import account_journal + from . import wizard + from . import report +except ImportError: + import logging + logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable') + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_move_line_report_xls/__init__.py b/account_move_line_report_xls/__init__.py index 75e3e519..e04bee2d 100644 --- a/account_move_line_report_xls/__init__.py +++ b/account_move_line_report_xls/__init__.py @@ -20,8 +20,8 @@ # ############################################################################## -from . import account_move_line try: + from . import account_move_line from . import report except ImportError: import logging