dp update modul1 modul2 modul3 ... ist jetzt moeglich

develop
Ahmed Aly 2017-06-26 14:41:30 +02:00
parent 4d9956f4a2
commit cc1046a8e1
2 changed files with 12 additions and 8 deletions

View File

@ -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',

View File

@ -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', [])