Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
6122 Lượt xem

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.
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

 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! ^^   

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

take a look at this,

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

Kind Regards.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 18
4313
5
thg 4 19
8864
1
thg 5 16
8248
1
thg 10 24
8842
2
thg 5 25
10094