=== modified file 'bin/osv/orm.py' --- bin/osv/orm.py 2009-08-20 15:29:21 +0000 +++ bin/osv/orm.py 2009-08-29 14:32:17 +0000 @@ -2097,16 +2097,16 @@ if d1: cr.execute('SELECT %s FROM \"%s\" WHERE id IN (%s) AND %s ORDER BY %s' % \ (','.join(fields_pre2 + ['id']), self._table, - ','.join([str(x) for x in sub_ids]), d1, - self._order), d2) + ','.join(['%s' for x in sub_ids]), d1, + self._order), sub_ids + d2) if not cr.rowcount == len({}.fromkeys(sub_ids)): raise except_orm(_('AccessError'), _('You try to bypass an access rule (Document type: %s).') % self._description) else: cr.execute('SELECT %s FROM \"%s\" WHERE id IN (%s) ORDER BY %s' % \ (','.join(fields_pre2 + ['id']), self._table, - ','.join([str(x) for x in sub_ids]), - self._order)) + ','.join(['%s' for x in sub_ids]), + self._order), sub_ids) res.extend(cr.dictfetchall()) else: res = map(lambda x: {'id': x}, ids)