From 1ba2ff569f11aa08185a42d2faae91ae8c290b05 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 21 Dec 2010 15:37:14 +0100 Subject: [PATCH] [FIX] read_group: better support for empty 'fields' or 'groupby' parameters lp bug: https://launchpad.net/bugs/692259 fixed bzr revid: odo@openerp.com-20101221143714-nvvmg2zmbkowbx60 --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 68e3c511f53..e34dc9f03db 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2318,7 +2318,7 @@ class orm(orm_template): offset_str = offset and ' offset %d' % offset or '' if len(groupby_list) < 2 and context.get('group_by_no_leaf'): group_count = '_' - cr.execute('SELECT min(%s.id) AS id, count(%s.id) AS %s_count, ' % (self._table, self._table, group_count) + flist + ' FROM ' + from_clause + where_clause + gb + limit_str + offset_str, where_clause_params) + cr.execute('SELECT min(%s.id) AS id, count(%s.id) AS %s_count' % (self._table, self._table, group_count) + (flist and ',') + flist + ' FROM ' + from_clause + where_clause + gb + limit_str + offset_str, where_clause_params) alldata = {} groupby = group_by for r in cr.dictfetchall():