Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4645 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

Thank you, Kiran and Niyas


Appreciated


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
říj 19
3123
2
čvc 15
6616
2
led 20
5758
3
bře 15
10429
1
lis 18
19290