2013-09-06 6 views
0

데이터가없는 그룹 열을 표시 할 수 없습니다,
는 내가 state 필드 칸반의 default_group_by 속성을 설정합니다.OpenERP 7.0 칸반보기 - 나는 모듈의 간판보기를 만든

[('new','Waiting Queue'),('in_progress','In Progress'),('done','Finished')] 

을하지만 어디 그 상태로 데이터를 생성 할 때까지 특정 상태의 데이터가, 상태에 대한 열이 표시되지 않습니다 거기에있다 : 상태가 포함되어 있습니다.
이 문제를 해결할 수있는 방법이 있습니까? 감사합니다 ...

답변

0

_group_by_full 메서드를 사용할 수 있습니다. 이 필드에 그룹화되어있는 경우 _read_group에 포함 할 ({id : fold} 레코드의 name_get을 반환해야합니다. 물론이 열에 대한 데이터가 아직 없더라도 원하는 열의 모든 값을 반환 할 수 있습니다. project.py 및 crm_lead.py에서 _group_by_full의 명확한 예를 볼 수 있습니다.

0

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 
} 

및 배 쌍 사전은 접을거야.