Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
4502 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur Meilleure réponse

Thank you, Kiran and Niyas


Appreciated


Avatar
Ignorer
Publications associées Réponses Vues Activité
0
oct. 19
3006
2
juil. 15
6479
2
janv. 20
5624
3
mars 15
10274
1
nov. 18
19088