From e2193e8a31e24b66b3b07fb6cd5a5dcd8e3a449e Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Tue, 28 Jun 2011 17:01:31 +0530 Subject: [PATCH] [IMP]: ir.actions.todo: When we pass res_id in the context of the action it should open the resource bzr revid: rpa@tinyerp.com-20110628113131-qhnp7qnirsqa2z4g --- openerp/addons/base/ir/ir_actions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index fa0fef36ef1..a057122c92a 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -844,6 +844,12 @@ class ir_actions_todo(osv.osv): wizard = self.browse(cr, uid, wizard_id, context=context) res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, [], context=context) res.update({'nodestroy': True}) + + # Open Specific resouce when res_id is provided in context + if res.get('context', {}): + ctx = eval(res['context']) + if ctx.get('res_id'): + res.update({'res_id': ctx.get('res_id')}) return res def action_open(self, cr, uid, ids, context=None):