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

I create a wizard that it's called when I select 2 or more elements in the tree view. 
The field that is in the wizard has an on_change that return a domain if the conditions are true, but when one of them is false I want to show an error message. 
And I used 

raise osv.except_osv(_('Error'), _('You have selected 1 or more tickets of different partners.'))
The problem is when I display this error and the user click in the button of the message error to close it, I want the wizard close too.
アバター
破棄
最善の回答

Hi Celia, when a error message is showed with popup, the python execution is stopped (It has been thrown an exception), and the control is managed by javascript.

You should change the javascript functionality for your purpose.

アバター
破棄
著作者 最善の回答

 Juan Vicente I see that answer in others answers, but if I close the wizard I can't display an error message. :(

Isaac, do you know where and how I have to do the change necessary in JavaScript code? 

Thanks for your answer! And ideas! ^^   

アバター
破棄
最善の回答

take a look at this,

return {'type': 'ir.actions.act_window_close'}

Kind Regards.

アバター
破棄
関連投稿 返信 ビュー 活動
1
2月 18
4289
5
4月 19
8835
1
5月 16
8212
1
10月 24
8828
2
5月 25
10081