From 493a2bba72a967accdf65e8881dada6854fd8b1d Mon Sep 17 00:00:00 2001 From: Peter Langenberg Date: Tue, 7 May 2013 08:56:51 +0200 Subject: [PATCH] filter by : opening only gives error message --- .../report/common_partner_reports.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/account_financial_report_webkit/report/common_partner_reports.py b/account_financial_report_webkit/report/common_partner_reports.py index 38113353..38e18743 100644 --- a/account_financial_report_webkit/report/common_partner_reports.py +++ b/account_financial_report_webkit/report/common_partner_reports.py @@ -110,12 +110,15 @@ class CommonPartnersReportHeaderWebkit(CommonReportHeaderWebkit): if not periods: return [] - periods = self.exclude_opening_periods(periods) + if mode != 'include_opening': + periods = self.exclude_opening_periods(periods) search_params = {'period_ids': tuple(periods), 'date_stop': period_stop.date_stop} - sql_conditions = " AND account_move_line.period_id in %(period_ids)s" + sql_conditions = "" + if periods: + sql_conditions = " AND account_move_line.period_id in %(period_ids)s" return sql_conditions, search_params