跳至內容
選單
此問題已被標幟
2 回覆
4651 瀏覽次數

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
3129
2
7月 15
6625
2
1月 20
5759
3
3月 15
10432
1
11月 18
19300