From: Christophe Simonis Date: Wed, 31 Oct 2012 13:26:38 +0000 (+0100) Subject: merge upstream X-Git-Tag: 7.0-server~245^2~49 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=478319c3ed11fd225e3ddb85a7749513ff671cc0;p=odoo%2Fodoo.git merge upstream bzr revid: chs@openerp.com-20121031132638-nc2o9v0gnonl5l7l --- 478319c3ed11fd225e3ddb85a7749513ff671cc0 diff --cc openerp/addons/base/res/res_config.py index 93afe1a,1aa108c..055781c --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@@ -525,27 -527,22 +526,31 @@@ class res_config_settings(osv.osv_memor getattr(self, method)(cr, uid, ids, context) # module fields: install/uninstall the selected modules - to_install_ids = [] + to_install_names = [] to_uninstall_ids = [] + lm = len('module_') for name, module in classified['module']: if config[name]: - if module.state == 'uninstalled': to_install_ids.append(module.id) + if not module or module.state == 'uninstalled': + to_install_names.append(name[lm:]) 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 module and module.state in ('installed', 'to upgrade'): + to_uninstall_ids.append(module.id) + + if to_uninstall_ids: + ir_module.button_immediate_uninstall(cr, uid, to_uninstall_ids, context=context) + + if to_install_names: + return { + 'type': 'ir.actions.client', + 'tag': 'apps', + 'params': {'modules': to_install_names}, + } + config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} + if config.get('type') not in ('ir.actions.act_window_close',): + return config + # force client-side reload (update user menu and current view) return { 'type': 'ir.actions.client',