From 6eff548f0bbc69750221124392c6cd16f537e227 Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Wed, 4 Aug 2010 17:51:17 +0200 Subject: [PATCH] [FIX] Fixed previous fix: where clause might be empty. bzr revid: jth@openerp.com-20100804155117-gazy6gibbyk01wqz --- bin/osv/orm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 7b670b0be22..cd5dc9949d8 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3823,7 +3823,10 @@ class orm(orm_template): offset_str = offset and ' offset %d' % offset or '' where.extend(qu1_join) - where_str = " WHERE %s" % " AND ".join(where) + if where: + where_str = " WHERE %s" % " AND ".join(where) + else: + where_str = "" if count: cr.execute('select count(%s.id) from ' % self._table +