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

I understand how a button calls a method defined on a model


But what should I write in the method to open a specific view ?

Could I see any example ?

Thanks

아바타
취소
베스트 답변

Hi ,

Refer this to open form view on a button click

def action_view_invoice(self):
return {
'name': _('Customer Invoice'),
'view_mode': 'form',
'view_id': self.env.ref('account.view_move_form').id,
'res_model': 'account.move',
'context': "{'move_type':'out_invoice'}",
'type': 'ir.actions.act_window',
'res_id': self.account_move.id,
}


아바타
취소
작성자 베스트 답변

Thank you, Kiran and Niyas


Appreciated


아바타
취소
관련 게시물 답글 화면 활동
0
10월 19
3282
2
7월 15
6825
2
1월 20
5925
3
3월 15
10678
1
11월 18
19635