From 180582656674fb2effb615fc1c8fb8a6131651c0 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 25 Sep 2012 17:19:44 +0200 Subject: [PATCH] [FIX] res_config: only install selected modules bzr revid: chs@openerp.com-20120925151944-84a93rm1yvza79js --- openerp/addons/base/res/res_config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 0ff4b5104d8..bba206294bf 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -530,10 +530,12 @@ class res_config_settings(osv.osv_memory): to_uninstall_ids = [] lm = len('module_') for name, module in classified['module']: - if module and module.state in ('installed', 'to upgrade'): - to_uninstall_ids.append(module.id) + if config[name]: + if not module or module.state == 'uninstalled': + to_install_names.append(name[lm:]) else: - to_install_names.append(name[lm:]) + 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) @@ -545,8 +547,6 @@ class res_config_settings(osv.osv_memory): 'params': {'modules': to_install_names}, } - #return ir_module.install_by_names(cr, uid, to_install_names, context=context) - # force client-side reload (update user menu and current view) return { 'type': 'ir.actions.client',