summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/wizard
diff options
context:
space:
mode:
authorHarshad Modi <hmo@tinyerp.com>2008-06-26 05:42:03 +0000
committerHarshad Modi <hmo@tinyerp.com>2008-06-26 05:42:03 +0000
commitd9b7a6945187340586c4ecfddef00e7ff2816d64 (patch)
treed56ef7ad4479ac3d22c619216a3e13200c8d2574 /bin/addons/base/module/wizard
parentf5d02752c70fcbbf8b1cbde7148c176a5eb20948 (diff)
modification upgrade wizard:
* display another screen is there is nothing to upgrade bzr revid: hmo@tinyerp.com-18ff38286ad43dd791fe9c5e95d703b660d25c03
Diffstat (limited to 'bin/addons/base/module/wizard')
-rw-r--r--bin/addons/base/module/wizard/wizard_module_upgrade.py24
1 files changed, 24 insertions, 0 deletions
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',