diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 07807c61..b89c5f0f 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -20,7 +20,7 @@ def main(): print ' Setup-Schritte auf' print ' rollout Setzt Dokumentnummern, importiert Benutzer,' print ' setzt dp_dmi auf noupdate, ...' - print ' update module_name Modul updaten' + print ' update modul1 modul2 ... Module updaten' print ' install module_name Modul installieren' print ' uninstall module_name Modul deinstallieren' print ' cancel_upgrade module_name Abbruch Modulinstallation' @@ -56,8 +56,9 @@ def main(): return else: if len(argv) != 2: - if len(argv) == 3 and argv[1] in ['update', 'install', 'uninstall', 'cancel_update', 'setup_part']: - # 'update' requires additional param 'module_name' + if len(argv) == 3 and argv[1] in ['install', 'uninstall', 'cancel_update', 'setup_part']: + pass + elif len(argv) >= 3 and argv[1] == 'update': pass else: _usage() @@ -145,7 +146,7 @@ def main(): ] if cmd == 'update': - instance.config.module_name = argv[2] + instance.config.module_name = argv[2:] methods = [ 'login', 'update_module', diff --git a/setup/lib/functions.py b/setup/lib/functions.py index 59c2e209..a9061a20 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -471,10 +471,13 @@ class DatenpolFunctions(): def update_module(self): """Aktualisiere Modul""" - module_name = self.config.module_name - mod_ids = self._execute('ir.module.module', 'search', [('name', '=', module_name), ('state', '=', 'installed')]) - if not len(mod_ids) == 1: - raise Exception('Module "%s" not found or not installed.' % module_name) + module_names = self.config.module_name + mod_ids = [] + for module_name in module_names: + mod_id = self._execute('ir.module.module', 'search', [('name', '=', module_name), ('state', '=', 'installed')]) + if not len(mod_id) == 1: + raise Exception('Module "%s" not found or not installed.' % module_name) + mod_ids += mod_id self._execute('ir.module.module', 'button_upgrade', mod_ids) self._execute('base.module.upgrade', 'upgrade_module', [])