osv.osv 클래스에 _group_by_full dictionnary로 추가 할 수 있습니다.
예를 들어 내 샘플 코드 확인 : 각 해당 칼럼 사실 경우 것을 {BOOL ID} 결과는 튜플들의 목록 (ID, 이름)를 포함하다
def _read_group_state_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
stage_obj = self.pool.get('produce.book.stage')
order = stage_obj._order
if read_group_order == 'stage_id desc':
order = "%s desc" % order
# perform search
stage_ids = stage_obj._search(cr, uid, [], order=order, access_rights_uid=access_rights_uid, context=context)
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
# restore order of the search
result.sort(lambda x, y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
fold = {}
for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context):
fold[stage.id] = stage.fold or False
return result, fold
_group_by_full = {
'stage_id': _read_group_state_ids
}
및 배 쌍 사전은 접을거야.