Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
4680 Prikazi

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
Opusti
Best Answer

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
Opusti
Avtor Best Answer

Thank you, Kiran and Niyas


Appreciated


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
okt. 19
3144
2
jul. 15
6646
2
jan. 20
5777
3
mar. 15
10450
1
nov. 18
19315