[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
This commit is contained in:
parent
49bd4d1aba
commit
1ba2ff569f
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue