İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
4499 Görünümler

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

Avatar
Vazgeç
En İyi Yanı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,
}


Avatar
Vazgeç
Üretici En İyi Yanıt

Thank you, Kiran and Niyas


Appreciated


Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 19
3004
2
Tem 15
6478
2
Oca 20
5623
3
Mar 15
10272
1
Kas 18
19086