From db35042ff828b2b0cad8f74292658eb600f4f7f0 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 5 Feb 2013 16:15:48 +0100 Subject: [PATCH] [FIX] ir_action: read accept list ids or id bzr revid: chm@openerp.com-20130205151548-t66esec4ygrw6z4v --- openerp/addons/base/ir/ir_actions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index aae45805502..7ea98b3b0cf 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -262,6 +262,9 @@ class act_window(osv.osv): } def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'): + u = isinstance(ids, (int, long)) + if u: + ids = [ids] results = super(act_window, self).read(cr, uid, ids, fields=fields, context=context, load=load) if not fields or 'help' in fields: @@ -276,6 +279,8 @@ class act_window(osv.osv): custom_context = dict(context.items() + (eval(res['context'] or "{}", dic) or {}).items()) res['help'] = self.pool.get(res.get('res_model')).dynamic_help(cr, uid, res.get('help', ""), context=custom_context) + if u: + return results[0] return results def for_xml_id(self, cr, uid, module, xml_id, context=None):