[FIX] account: report with warning if the start and end period is not given in wizard
bzr revid: mra@mra-laptop-20100625112216-bxuecavghwb7j364
This commit is contained in:
parent
1d6b37019b
commit
0c66d23915
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue