[FIX] account: onchange on common report wizard for filter by period if no filter then make periods field blank so that it will not disply on report

bzr revid: mra@mra-laptop-20100712061310-4r0ybrz73buu3z0i
This commit is contained in:
Mustufa Rangwala 2010-07-12 11:43:10 +05:30
parent ca7e9ece69
commit e8b2149bbb
2 changed files with 8 additions and 1 deletions

View File

@ -55,6 +55,13 @@ class account_common_report(osv.osv_memory):
# else:
# return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
def onchange_filter(self, cr, uid, ids, filter='filter_no', context=None):
res = {}
if filter == 'filter_no':
res['value'] = {'period_from': False, 'period_to': False}
return res
return {}
def _get_account(self, cr, uid, context=None):
tmp = self.pool.get('account.account').search(cr, uid, [], limit=1 )
if not tmp:

View File

@ -20,7 +20,7 @@
<group colspan="2" name='Filters'>
<notebook tabpos="up">
<page string="Filters">
<field name="filter"/>
<field name="filter" on_change="onchange_filter(filter)" />
<separator string="Dates" colspan="4"/>
<field name="date_from" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<field name="date_to" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>