From fa3a3414f22c7c552b04a8e5dbf11f153b4a94d2 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 19 Mar 2013 15:27:01 +0100 Subject: [PATCH] [FIX] ir.actions.action: fix the execute wich install/uninstall modules and thus invalidate its own pool. bzr revid: vmt@openerp.com-20130319142701-1cvo6dh2yvg4z81f --- openerp/addons/base/ir/ir_actions.py | 4 ++-- openerp/addons/base/res/res_config.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index beb4e27200a..3e29a0a9b97 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -207,7 +207,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) @@ -792,7 +792,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 diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 3137cab24d9..bfa9abe5607 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -557,7 +557,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