콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4344 화면

I need to add a button in each row of a report. That i need to see some data while clicking on the button. The data will be change according to the value of the report line with some conditions.

아바타
취소
베스트 답변

Hi,

You need to just add a button inside the report lines just like this.

<field name="report_line" nolabel="1">


        <tree>


            <button name="list_view" string="button" type="object"/>


    </tree>


</field>


Then, we need to define a function inside the report_line model to get the view according to your needs.

def list_view(self):
view_tree = self.env.ref('module_name.view_id').id
return {
'type': 'ir.actions.act_window',
'name': 'Name',
'view_mode': 'tree',
'res_model': 'model for the view',
'view_id': view_tree,
'domain': [()],
'context': "{'create': False}"
}

So here you need to find the view id, that we need to show and also you can give any domain according to your needs

Regards

아바타
취소
관련 게시물 답글 화면 활동
1
7월 24
1965
0
9월 24
1471
1
5월 24
2454
2
6월 23
2705
0
1월 20
160