Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4736 มุมมอง

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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 19
3186
2
ก.ค. 15
6693
2
ม.ค. 20
5822
3
มี.ค. 15
10551
1
พ.ย. 18
19396