Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4627 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

Thank you, Kiran and Niyas


Appreciated


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ott 19
3094
2
lug 15
6595
2
gen 20
5744
3
mar 15
10400
1
nov 18
19263