Skip to Content
मेन्यू
This question has been flagged
2 Replies
4742 Views

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
Discard
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
Discard
Author Best Answer

Thank you, Kiran and Niyas


Appreciated


Avatar
Discard
Related Posts Replies Views Activity
0
अक्तू॰ 19
3190
2
जुल॰ 15
6698
2
जन॰ 20
5827
3
मार्च 15
10557
1
नव॰ 18
19403