From d9b7a6945187340586c4ecfddef00e7ff2816d64 Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Thu, 26 Jun 2008 05:42:03 +0000 Subject: [PATCH] modification upgrade wizard: * display another screen is there is nothing to upgrade bzr revid: hmo@tinyerp.com-18ff38286ad43dd791fe9c5e95d703b660d25c03 --- .../module/wizard/wizard_module_upgrade.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/bin/addons/base/module/wizard/wizard_module_upgrade.py b/bin/addons/base/module/wizard/wizard_module_upgrade.py index 896555e4832..c5e035354ad 100644 --- a/bin/addons/base/module/wizard/wizard_module_upgrade.py +++ b/bin/addons/base/module/wizard/wizard_module_upgrade.py @@ -70,6 +70,17 @@ class wizard_info_get(wizard.interface): return {'module_info': '\n'.join(map(lambda x: x['name']+' : '+x['state'], res)), 'module_download': '\n'.join(url)} + def _check_upgrade_module(self,cr,uid,data,context): + db, pool = pooler.get_db_and_pool(cr.dbname) + cr = db.cursor() + mod_obj = pool.get('ir.module.module') + ids = mod_obj.search(cr, uid, [ + ('state', 'in', ['to upgrade', 'to remove', 'to install'])]) + if ids and len(ids): + return 'next' + else: + return 'end' + def _upgrade_module(self, cr, uid, data, context): db, pool = pooler.get_db_and_pool(cr.dbname) cr = db.cursor() @@ -92,6 +103,10 @@ class wizard_info_get(wizard.interface): states = { 'init': { + 'actions': [], + 'result' : {'type': 'choice', 'next_state': _check_upgrade_module } + }, + 'next': { 'actions': [_get_install], 'result': {'type':'form', 'arch':view_form, 'fields': view_field, 'state':[ @@ -109,6 +124,15 @@ class wizard_info_get(wizard.interface): ] } }, + 'end': { + 'actions': [], + 'result': {'type':'form', 'arch':view_form_end, 'fields': {}, + 'state':[ + ('end', 'Close', 'gtk-close', True), + ('config', 'Start configuration', 'gtk-ok', True) + ] + } + }, 'config':{ 'result': { 'type': 'action',