Fabien (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-action-followers-hmo into 
lp:openobject-server.

Requested reviews:
  Fabien (Open ERP) (fp-tinyerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-action-followers-hmo/+merge/130748
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-action-followers-hmo/+merge/130748
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-action-followers-hmo.
=== modified file 'openerp/addons/base/module/module.py'
--- openerp/addons/base/module/module.py	2012-10-03 16:18:07 +0000
+++ openerp/addons/base/module/module.py	2012-10-22 08:20:48 +0000
@@ -412,6 +412,7 @@
         return list(known_dep_ids)
 
     def _button_immediate_function(self, cr, uid, ids, function, context=None):
+        modules = [x.name for x in self.browse(cr, uid, ids, context=context)]
         function(cr, uid, ids, context=context)
 
         cr.commit()
@@ -421,9 +422,12 @@
         if config.get('type') not in ('ir.actions.reload', 'ir.actions.act_window_close'):
             return config
 
-        # reload the client; open the first available root menu
+        # reload the client; open the root menu
+        #TOFIX: should open the root menu of Application of installing module. eg after install purchase_requsition module, open "Purchase" menu instead of "Home". Right now, root menu of Application could not be identify. suggestion: to add one many2one field "root_menu_id" in application model.
         menu_obj = self.pool.get('ir.ui.menu')
-        menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
+        menu_ids = self.pool.get('ir.model.data').search(cr, uid, [('module','in', modules),('model','=','ir.ui.menu')])
+        if not menu_ids:
+            menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
 
         return {
             'type' : 'ir.actions.client',

=== modified file 'openerp/addons/base/res/res_config.py'
--- openerp/addons/base/res/res_config.py	2012-09-28 12:22:06 +0000
+++ openerp/addons/base/res/res_config.py	2012-10-22 08:20:48 +0000
@@ -534,9 +534,10 @@
             else:
                 if module.state in ('installed','upgrade'): to_uninstall_ids.append(module.id)
 
-        if to_install_ids or to_uninstall_ids:
-            ir_module.button_uninstall(cr, uid, to_uninstall_ids, context=context)
-            ir_module.button_immediate_install(cr, uid, to_install_ids, context=context)
+        if to_uninstall_ids:
+            return ir_module.button_uninstall(cr, uid, to_uninstall_ids, context=context)
+        if to_install_ids:
+            return ir_module.button_immediate_install(cr, uid, to_install_ids, context=context)
 
         # force client-side reload (update user menu and current view)
         return {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to