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

hi, i try to create a new record in a smart button, but i have the next error:  Record does not exist or has been deleted.

return {               

'type': 'ir.actions.act_window',               

'name': 'model',               

'view_mode': 'tree,form',              

 'res_model': 'model.name',               

'domain': [('field.id', '=', self.id)],          }

}


that's my code in my def of smart button

アバター
破棄

hi,
you have a view where your smart button is defined.
when you click on the smart button, a record X is created and you want to display it right ?

If it's the case then in your return dict you add key 'res_id': X.id and remove domain.

P.S: self.id refers to the model which view is displayed, not your created record..

関連投稿 返信 ビュー 活動
1
6月 25
1707
3
7月 25
3332
1
5月 25
1473
1
5月 25
1737
4
5月 25
2872