[IMP] res_config: return correct action for installing modules from apps

bzr revid: chs@openerp.com-20120921132911-n6mb58gxlo9aqflm
This commit is contained in:
Christophe Simonis 2012-09-21 15:29:11 +02:00
parent f988ed24f6
commit 7260de28d0
1 changed files with 9 additions and 2 deletions

View File

@ -528,17 +528,24 @@ class res_config_settings(osv.osv_memory):
# module fields: install/uninstall the selected modules
to_install_names = []
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)
else:
to_install_names.append(name)
to_install_names.append(name[lm:])
if to_uninstall_ids:
ir_module.button_immediate_uninstall(cr, uid, to_uninstall_ids, context=context)
if to_install_names:
return ir_module.install_by_names(cr, uid, to_install_names, context=context)
return {
'type': 'ir.actions.client',
'tag': 'apps',
'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 {