Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4500 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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,
}


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thank you, Kiran and Niyas


Appreciated


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 19
3004
2
thg 7 15
6478
2
thg 1 20
5623
3
thg 3 15
10272
1
thg 11 18
19086