[IMP] res.config.settings: reopen the wizard menu after applying changes

bzr revid: rco@openerp.com-20120405074102-6x3bp5moqr9pen20
This commit is contained in:
Raphael Collet
2012-04-05 09:41:02 +02:00
parent 9f0d92229c
commit 0e19c4d7d1
+11 -6
View File
@@ -540,14 +540,19 @@ class res_config_settings(osv.osv_memory):
if to_install_ids:
ir_module.button_immediate_install(cr, uid, to_install_ids, context)
# open the root menu Settings, and force client-side refresh
menu = ir_model_data.get_object(cr, uid, 'base', 'menu_administration', context)
# open the menu for this wizard (or Settings), and force client-side refresh
act_ids = self.pool.get('ir.actions.act_window').search(cr, uid, [('res_model', '=', self._name)])
act_refs = ['ir.actions.act_window,%s' % id for id in act_ids]
val_ids = ir_values.search(cr, uid, [('model', '=', 'ir.ui.menu'), ('key', '=', 'action'),
('key2', '=', 'tree_but_open'), ('value', 'in', act_refs)])
if val_ids:
menu_id = ir_values.browse(cr, uid, val_ids[0]).res_id
else:
menu_id = ir_model_data.get_object(cr, uid, 'base', 'menu_administration', context).id
return {
'type': 'ir.ui.menu',
'menu_id': menu.id,
'reload' : True,
'menu_id': menu_id,
'reload': True,
}
res_config_settings()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: