From ff151bb058eb384e2c1063c283d9e4ec5766bb0c Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Wed, 24 Oct 2012 09:21:52 +0200 Subject: [PATCH] [FIX] error message when the opening period is missing (lp:c2c-addons/6.1 rev 91.1.1) --- account_financial_report_webkit/report/common_reports.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_financial_report_webkit/report/common_reports.py b/account_financial_report_webkit/report/common_reports.py index bce56a45..ab37d18d 100644 --- a/account_financial_report_webkit/report/common_reports.py +++ b/account_financial_report_webkit/report/common_reports.py @@ -347,6 +347,13 @@ class CommonReportHeaderWebkit(common_report_header): """ Read opening balances from the opening balance """ opening_period_selected = self.get_included_opening_period(start_period) + if not opening_period_selected: + raise osv.except_osv( + _('Error'), + _('No opening period found to compute the opening balances.\n' + 'You have to configure a period on the first of January' + ' with the special flag.')) + res = {} for account_id in account_ids: res[account_id] = self._compute_init_balance(account_id, opening_period_selected, mode='read')