Attention:
warning = { 'title': _('Warning!'), 'message': _('Exists the discount limit'), } return {'warning': warning}
UserError
raise UserError(_('Exists the discount limit'))
What is the difference between Warning and UserError in odoo
To answer it in a simple way, they are both the same in an ode. Because if you are checking odoo / exception.py, specify an exception here
He clearly understood that he referred to Warning as a UserError. The underrun warning is deprecated in odoo v9 and v10 due to ambiguity or collision with embedded python.
For information on python warning, consult the python warning documentation .
odoo.exceptions.UserError Warning
python . , Odoo. RPC, , -, , -.
UserError , odoo.exceptions. OSError UserError, . . Odoo 9 10 UserError .
: Odoo 8 openerp.exception. UserError 9 10 , ( ) python, , UserError odoo 9 10.
, , , , .
Source: https://habr.com/ru/post/1679448/More articles:Custom ToJSON instance for Persistent Key - haskellMediaFoundation, bitmap to mp4 - c ++Unable to install LWIP via NPM (ZLIB_VERNUM! = PNG_ZLIB_VERNUM) - npmSpring-Boot, Unable to save Unicode string in MySql using Spring -data JPA - springPath-dependent types without a path? - scalaUnable to select options in weak dynamic message menu - slack-apiWhy does adding another layer to a simple Tensorflow neural network example break it? - pythonКак преобразовать строку JSON в объект списка Java? - javaProper execution of waiting and notification in Kotlin - kotlinHow do I get @ vimeo / player to work on my Angular2 / Typescript project? - angularAll Articles