Account_report:Added notification to select record to fit report page-width.

bzr revid: jvo@tinyerp.com-20081027092549-g25sbbkoklda5f20
This commit is contained in:
Jay Vora 2008-10-27 14:55:49 +05:30
parent e80eb0dc6d
commit 0c8ae5b9c1
1 changed files with 6 additions and 1 deletions

View File

@ -61,6 +61,11 @@ def _load_base(self, cr, uid, data, context):
next_fields['base_selection']['relation']='account.period'
return data['form']
def _check_len(self, cr, uid, data, context):
if len(data['form']['base_selection'][0][2])>12:
raise wizard.except_wizard('User Error!',"Please select maximum 12 records to fit the page-width.")
return data['form']
class wizard_print_indicators(wizard.interface):
states = {
'init': {
@ -72,7 +77,7 @@ class wizard_print_indicators(wizard.interface):
'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]}
},
'print': {
'actions':[],
'actions':[_check_len],
'result' :{'type':'print','report':'print.indicators', 'state':'end'}
}
}