[FIX] ir.actions.action: fix the execute wich install/uninstall modules and thus invalidate its own pool.

bzr revid: vmt@openerp.com-20130319150057-fq6nkp4qhgy9x9mq
This commit is contained in:
Vo Minh Thu 2013-03-19 16:00:57 +01:00
parent 314fb5de44
commit 83786b4178
2 changed files with 6 additions and 3 deletions

View File

@ -206,7 +206,7 @@ class act_window(osv.osv):
def _search_view(self, cr, uid, ids, name, arg, context=None):
res = {}
for act in self.browse(cr, uid, ids, context=context):
field_get = self.pool.get(act.res_model).fields_view_get(cr, uid,
field_get = self.pool[act.res_model].fields_view_get(cr, uid,
act.search_view_id and act.search_view_id.id or False,
'search', context=context)
res[act.id] = str(field_get)
@ -791,7 +791,7 @@ Launch Manually Once: after having been launched manually, it sets automatically
act_type = self.pool.get('ir.actions.actions').read(cr, uid, wizard.action_id.id, ['type'], context=context)
res = self.pool.get(act_type['type']).read(cr, uid, wizard.action_id.id, [], context=context)
if act_type<>'ir.actions.act_window':
if act_type['type'] != 'ir.actions.act_window':
return res
res.setdefault('context','{}')
res['nodestroy'] = True

View File

@ -554,7 +554,10 @@ class res_config_settings(osv.osv_memory):
'params': {'modules': to_install_missing_names},
}
config = self.pool.get('res.config').next(cr, uid, [], context=context) or {}
# After the uninstall/install calls, the self.pool is no longer valid.
# So we reach into the RegistryManager directly.
res_config = openerp.modules.registry.RegistryManager.get(cr.dbname)['res.config']
config = res_config.next(cr, uid, [], context=context) or {}
if config.get('type') not in ('ir.actions.act_window_close',):
return config