[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
This commit is contained in:
P. Christeas 2009-09-25 23:34:27 +03:00
parent 6021b6dff3
commit 8afaffc811
1 changed files with 2 additions and 1 deletions

View File

@ -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():