From 8828c08f417962c5595cd3d9c3f77d1c172053cf Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 3 Sep 2010 11:37:04 +0530 Subject: [PATCH] [IMP]: base: When there is no module to upgrade and "Apply Scheduled Upgrades" wizard is called, it should not display form view of module list bzr revid: rpa@tinyerp.com-20100903060704-5y1cpdx7p8zo929e --- .../base/module/wizard/base_module_upgrade.py | 39 ++++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/bin/addons/base/module/wizard/base_module_upgrade.py b/bin/addons/base/module/wizard/base_module_upgrade.py index e51fe24..fe85cb0 100644 --- a/bin/addons/base/module/wizard/base_module_upgrade.py +++ b/bin/addons/base/module/wizard/base_module_upgrade.py @@ -34,6 +34,40 @@ class base_module_upgrade(osv.osv_memory): 'module_info': fields.text('Modules to update',readonly=True), } + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + """ Changes the view dynamically + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param context: A standard dictionary + @return: New arch of view. + """ + res = super(base_module_upgrade, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) + record_id = context and context.get('active_id', False) or False + active_model = context.get('active_model') + if (not record_id) or (not active_model): + return res + + ids = self.get_module_list(cr, uid, context=context) + if not ids: + res['arch'] = '''
+ +