[correction]Behaviour of create menu wizard of dashboard
bzr revid: jvo@tinyerp.com-20090101095706-z7kxzeqnq83l1lpm
This commit is contained in:
@@ -38,9 +38,17 @@ section_fields = {
|
||||
'menu_parent_id': {'string':'Parent Menu', 'type':'many2one', 'relation':'ir.ui.menu', 'required':True},
|
||||
}
|
||||
|
||||
def check_views(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
board = pool.get('board.board').browse(cr, uid, data['id'])
|
||||
if not board.line_ids:
|
||||
raise wizard.except_wizard('User Error!',"Please Insert Dashboard View(s) !")
|
||||
return data['form']
|
||||
|
||||
def board_menu_create(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
board = pool.get('board.board').browse(cr, uid, data['id'])
|
||||
|
||||
action_id = pool.get('ir.actions.act_window').create(cr, uid, {
|
||||
'name': board.name,
|
||||
'view_type':'form',
|
||||
@@ -54,12 +62,13 @@ def board_menu_create(self, cr, uid, data, context):
|
||||
'icon': 'STOCK_SELECT_COLOR',
|
||||
'action': 'ir.actions.act_window,'+str(action_id)
|
||||
}, context)
|
||||
|
||||
return {}
|
||||
|
||||
class wizard_section_menu_create(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'actions': [check_views],
|
||||
'result': {'type':'form', 'arch':section_form, 'fields':section_fields, 'state':[('end','Cancel'),('create_menu','Create Menu')]}
|
||||
},
|
||||
'create_menu': {
|
||||
|
||||
Reference in New Issue
Block a user