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

I am working on odoo 9. I need to show popup. I am using that code to show popup

raise osv.except_osv(_('UserError!'), _("Invoice not completed yet. Please complete that invoice"))

and it shows that message

"WARNING odoo openerp.exceptions: except_orm is deprecated. Please use specific exceptions like UserError or AccessError", and popup never shows up. Please help me in that

Another thing, for example if i have invoice id 1, or any other invoice info. I want to show user an lnvoice link, when user click on that link user will be redirected to that invoice. Please help me in that

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

Hello Ahmed,


Please Use

from openerp.exceptions import  Warning


if condition:

    raise Warning("Message")

OR

from openerp.exceptions import except_orm,

if condition:

     raise except_orm(_('Warning'), _('Message'))



Thanks

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 23
2995
4
thg 12 21
33036
2
thg 8 18
7584
1
thg 7 17
4553
2
thg 9 16
8029