[FIX] ir.actions.action: fix the execute wich install/uninstall modules and thus...
authorVo Minh Thu <vmt@openerp.com>
Tue, 19 Mar 2013 15:00:57 +0000 (16:00 +0100)
committerVo Minh Thu <vmt@openerp.com>
Tue, 19 Mar 2013 15:00:57 +0000 (16:00 +0100)
bzr revid: vmt@openerp.com-20130319150057-fq6nkp4qhgy9x9mq

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

index 526c614..36be271 100644 (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
index 0508030..8a7fa73 100644 (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