[FIX] ir.actions.action: fix the execute wich install/uninstall modules and thus...
authorVo Minh Thu <vmt@openerp.com>
Tue, 19 Mar 2013 14:27:01 +0000 (15:27 +0100)
committerVo Minh Thu <vmt@openerp.com>
Tue, 19 Mar 2013 14:27:01 +0000 (15:27 +0100)
bzr revid: vmt@openerp.com-20130319142701-1cvo6dh2yvg4z81f

openerp/addons/base/ir/ir_actions.py
openerp/addons/base/res/res_config.py

index beb4e27..3e29a0a 100644 (file)
@@ -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
index 3137cab..bfa9abe 100644 (file)
@@ -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