我想在特定条件下在模块的用户界面端显示警告消息。为此,我编写了这样的代码。
raise osv.except_osv(('Warning!'), ("Entered Quantity is greater than quantity on source."))
但在用户界面端的这种情况下,它只显示加载图像。
在控制台我得到了这样的错误。
2013-06-10 09:45:53,612 364
ERROR None openerp.netsvc: Warning! Entered Quantity is greater than quantity on source.
Traceback (most recent call last):
File "C:\OpenErp\openerp\openobject-server\openerp\netsvc.py", line 361, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "C:\OpenErp\openerp\openobject-server\openerp\service\web_services.py", line 585, in dispatch
res = fn(db, uid, *params)
File "C:\OpenErp\openerp\openobject-server\openerp\osv\osv.py", line 167, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "C:\OpenErp\openerp\openobject-server\openerp\osv\osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "C:\OpenErp\openerp\openobject-server\openerp\osv\osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "C:\OpenErp\openerp\openobject-server\openerp\osv\osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "C:\OpenErp\openerp\openobject-addons\mat_mgmt\mat_mgmt.py", line 101, in button_confirm
raise osv.except_osv(('Warning!'), ("Entered Quantity is greater than quantity on source."))
except_osv:
('Warning!', 'Entered Quantity is greater than quantity on source.')
c:\openerp\openerp\openobject-addons\mat_mgmt\mat_mgmt.py(101)button_confirm()
-> raise osv.except_osv(('Warning!'), ("Entered Quantity is greater than quantity on source."))
我想在用户界面端显示警告消息。