From 0c66d23915da2732dfd420e37c8ae81343db04e7 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 25 Jun 2010 16:52:16 +0530 Subject: [PATCH] [FIX] account: report with warning if the start and end period is not given in wizard bzr revid: mra@mra-laptop-20100625112216-bxuecavghwb7j364 --- addons/account/wizard/account_common_report.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_common_report.py b/addons/account/wizard/account_common_report.py index d87956b77a9..8ef94c5dfba 100644 --- a/addons/account/wizard/account_common_report.py +++ b/addons/account/wizard/account_common_report.py @@ -102,6 +102,8 @@ class account_common_report(osv.osv_memory): result['date_from'] = data['form']['date_from'] result['date_to'] = data['form']['date_to'] elif data['form']['filter'] == 'filter_period': + if data['form']['period_from'] == False or data['form']['period_to'] == False: + raise osv.except_osv(_('Error'),_('Select Start period and End period')) period_date_start = period_obj.read(cr, uid, data['form']['period_from'], ['date_start'])[0]['date_start'] period_date_stop = period_obj.read(cr, uid, data['form']['period_to'], ['date_stop'])[0]['date_stop'] cr.execute('SELECT id FROM account_period WHERE date_start >= %s AND date_stop <= %s', (period_date_start, period_date_stop))