[ADD] Added /base/action/load controller

bzr revid: fme@openerp.com-20110421132354-ubji3zz8k181qlxu
This commit is contained in:
Fabien Meghazi 2011-04-21 15:23:54 +02:00
parent 912738c712
commit 85c28f6d23
1 changed files with 9 additions and 2 deletions

View File

@ -621,5 +621,12 @@ class Action(openerpweb.Controller):
_cp_path = "/base/action"
@openerpweb.jsonrequest
def load(self, req, action_id):
return {}
def load(self, req, action_id, context={}):
Actions = req.session.model('ir.actions.actions')
value = False
action_type = Actions.read([action_id], ['type'], context)
if action_type:
action = req.session.model(action_type[0]['type']).read([action_id], False, context)
if action:
value = action[0]
return {'value': value}