[FIX] orm.BaseModel.exists(): early return if no ids given
bzr revid: chs@openerp.com-20130919114711-ofx2aubtr5z7dgh4
This commit is contained in:
parent
ffdcf33673
commit
28b09221d6
|
@ -5117,6 +5117,8 @@ class BaseModel(object):
|
|||
"""
|
||||
if type(ids) in (int, long):
|
||||
ids = [ids]
|
||||
if not ids:
|
||||
return []
|
||||
query = 'SELECT id FROM "%s"' % self._table
|
||||
cr.execute(query + "WHERE ID IN %s", (tuple(ids),))
|
||||
return [x[0] for x in cr.fetchall()]
|
||||
|
|
Loading…
Reference in New Issue