From 8afaffc8117f6f017fee9f76ce8ec1d047610839 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Fri, 25 Sep 2009 23:34:27 +0300 Subject: [PATCH] [Fix] Tolerate ids that came as strings. If the list of IDs contains strings with numeric values (like '123'), allow them to be used. If the strings cannot be parsed, the int() will raise an Exception itself. bzr revid: p_christ@hol.gr-20090925203427-3ckavo3w34dokwij --- bin/osv/orm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 5ee29ca2bdd..dabd28201b1 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2108,9 +2108,10 @@ class orm(orm_template): self.pool.get('ir.model.access').check(cr, user, self._name, 'read', context=context) if not fields: fields = self._columns.keys() + self._inherit_fields.keys() - select = ids if isinstance(ids, (int, long)): select = [ids] + else: + select = map(int,ids) result = self._read_flat(cr, user, select, fields, context, load) for r in result: for key, v in r.items():