[IMP] module: use client action 'reload' when returning from module installation
authorRaphael Collet <rco@openerp.com>
Tue, 15 May 2012 14:07:56 +0000 (16:07 +0200)
committerRaphael Collet <rco@openerp.com>
Tue, 15 May 2012 14:07:56 +0000 (16:07 +0200)
bzr revid: rco@openerp.com-20120515140756-vhw0aw71fbv0p08b

openerp/addons/base/module/module.py

index c634230..bd43691 100644 (file)
@@ -351,15 +351,15 @@ class module(osv.osv):
         if config.get('type') not in ('ir.actions.reload', 'ir.actions.act_window_close'):
             return config
 
+        # reload the client
+        action = {
+            'type': 'ir.actions.client',
+            'tag': 'reload',
+        }
         menu_ids = self.root_menus(cr,uid,ids,context)
         if menu_ids:
-            action = {
-                'type': 'ir.ui.menu',
-                'menu_id': menu_ids[0],
-                'reload' : True,
-            }
-            return action
-        return False
+            action['params'] = {'menu_id': menu_ids[0]}
+        return action
 
     def button_install_cancel(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False})