跳至内容
菜单
此问题已终结
2 回复
4670 查看

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

形象
丢弃
最佳答案

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,
}


形象
丢弃
编写者 最佳答案

Thank you, Kiran and Niyas


Appreciated


形象
丢弃
相关帖文 回复 查看 活动
0
10月 19
3135
2
7月 15
6637
2
1月 20
5767
3
3月 15
10442
1
11月 18
19308