Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4625 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Autor Najlepsza odpowiedź

Thank you, Kiran and Niyas


Appreciated


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 19
3093
2
lip 15
6593
2
sty 20
5744
3
mar 15
10398
1
lis 18
19257