[FIX]:The records that has groupby field value = False or '' should also be returned to the client to show as 'Undefined'
bzr revid: nch@tinyerp.com-20100922055205-k9cu34iuzfhlvbg1
This commit is contained in:
parent
1e9167f9a9
commit
2d2e0b25a3
|
@ -2275,6 +2275,9 @@ class orm(orm_template):
|
|||
del r['id']
|
||||
if groupby and fget[groupby]['type'] == 'many2one':
|
||||
data_ids = self.search(cr, uid, [('id', 'in', alldata.keys())], order=groupby, context=context)
|
||||
# the IDS of the records that has groupby field value = False or ''
|
||||
# should be added too
|
||||
data_ids += filter(lambda x:x not in data_ids, alldata.keys())
|
||||
data = self.read(cr, uid, data_ids, groupby and [groupby] or ['id'], context=context)
|
||||
# restore order of the search as read() uses the default _order (this is only for groups, so the size of data_read shoud be small):
|
||||
data.sort(lambda x,y: cmp(data_ids.index(x['id']), data_ids.index(y['id'])))
|
||||
|
|
Loading…
Reference in New Issue