[FIX] problem with ir.actions.url in some cases
authorniv-openerp <nicolas.vanhoren@openerp.com>
Thu, 7 Jun 2012 13:54:12 +0000 (15:54 +0200)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Thu, 7 Jun 2012 13:54:12 +0000 (15:54 +0200)
lp bug: https://launchpad.net/bugs/1003923 fixed

bzr revid: nicolas.vanhoren@openerp.com-20120607135412-0uzquukg21pbm492

addons/web/controllers/main.py

index 6eb8ed9..1ccba0c 100644 (file)
@@ -1467,6 +1467,10 @@ class Binary(openerpweb.Controller):
 
 class Action(openerpweb.Controller):
     _cp_path = "/web/action"
+    
+    action_mapping = {
+        "ir.actions.act_url": "ir.actions.url",
+    }
 
     @openerpweb.jsonrequest
     def load(self, req, action_id, do_not_eval=False):
@@ -1479,7 +1483,9 @@ class Action(openerpweb.Controller):
             if action_type[0]['type'] == 'ir.actions.report.xml':
                 ctx.update({'bin_size': True})
             ctx.update(context)
-            action = req.session.model(action_type[0]['type']).read([action_id], False, ctx)
+            action_model = action_type[0]['type']
+            action_model = Action.action_mapping.get(action_model, action_model)
+            action = req.session.model(action_model).read([action_id], False, ctx)
             if action:
                 value = clean_action(req, action[0], do_not_eval)
         return {'result': value}