From 0c8ae5b9c11eb0b5741d69037b66693c5be421a3 Mon Sep 17 00:00:00 2001 From: Jay Vora Date: Mon, 27 Oct 2008 14:55:49 +0530 Subject: [PATCH] Account_report:Added notification to select record to fit report page-width. bzr revid: jvo@tinyerp.com-20081027092549-g25sbbkoklda5f20 --- addons/account_report/wizard/wizard_print_indicators.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py index b781073ddf4..17252e8b3c8 100644 --- a/addons/account_report/wizard/wizard_print_indicators.py +++ b/addons/account_report/wizard/wizard_print_indicators.py @@ -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'} } }