Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
4527 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor Mejor respuesta

Thank you, Kiran and Niyas


Appreciated


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
oct 19
3029
2
jul 15
6508
2
ene 20
5643
3
mar 15
10296
1
nov 18
19124