コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4672 ビュー

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
3136
2
7月 15
6638
2
1月 20
5768
3
3月 15
10442
1
11月 18
19309