Raphael Collet (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-application_setting_cleanup-atp into 
lp:openobject-server.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-application_setting_cleanup-atp/+merge/111394

Improvements in configuration wizards.
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-application_setting_cleanup-atp/+merge/111394
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-application_setting_cleanup-atp.
=== modified file 'openerp/addons/base/ir/ir_ui_menu.py'
--- openerp/addons/base/ir/ir_ui_menu.py	2012-06-04 21:32:12 +0000
+++ openerp/addons/base/ir/ir_ui_menu.py	2012-06-21 12:28:27 +0000
@@ -264,7 +264,8 @@
         res = {}
         for menu in self.browse(cr, uid, ids, context=context):
             res[menu.id] = {}
-            if menu.action and menu.action.type == 'ir.actions.act_window' and menu.action.res_model:
+            
+            if menu.action and menu.action.type == 'ir.actions.act_window' and menu.action.res_model:    
                 menu_needaction_res = self.pool.get(menu.action.res_model)._get_needaction_info(cr, uid, uid, domain=menu.action.domain, context=context)
             else:
                 menu_needaction_res = [False, 0]

=== modified file 'openerp/addons/base/res/res_config.py'
--- openerp/addons/base/res/res_config.py	2012-05-15 12:10:16 +0000
+++ openerp/addons/base/res/res_config.py	2012-06-21 12:28:27 +0000
@@ -500,9 +500,9 @@
         # overridden to make fields of installed modules readonly
         res = super(res_config_settings, self).fields_get(cr, uid, allfields, context, write_access)
         classified = self._get_classified_fields(cr, uid, context)
-        for name, module in classified['module']:
-            if name in res and module.state in ('installed', 'to install', 'to upgrade'):
-                res[name]['readonly'] = True
+        #for name, module in classified['module']:
+        #   if name in res and module.state in ('installed', 'to install', 'to upgrade'):
+        #       res[name]['readonly'] = False
         return res
 
     def execute(self, cr, uid, ids, context=None):
@@ -533,11 +533,21 @@
 
         # module fields: install immediately the selected modules
         to_install_ids = []
+        to_uninstall_ids = []
         for name, module in classified['module']:
-            if config[name] and module.state == 'uninstalled':
-                to_install_ids.append(module.id)
+            if config[name]:
+                if module.state == 'uninstalled': to_install_ids.append(module.id)
+            else:
+                if module.state in ['installed','upgrade']: to_uninstall_ids.append(module.id)
         if to_install_ids:
             ir_module.button_immediate_install(cr, uid, to_install_ids, context)
+        if to_uninstall_ids:
+            # Module unInstallation.
+            dep_ids = ir_module.downstream_dependencies(cr, uid, to_uninstall_ids, context=context)
+            ir_module.module_uninstall(cr, uid, to_uninstall_ids + dep_ids , context)
+            cr.commit()
+            _logger.info('Reloading registry once more after uninstalling modules')
+            pooler.restart_pool(cr.dbname, update_module=True)
 
         # 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