What is the difference between "warning" and "UserError" in odoo?

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

+4
source share
2 answers

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

+1

python . , Odoo. RPC, , -, , -.

UserError , odoo.exceptions. OSError UserError, . . Odoo 9 10 UserError .

: Odoo 8 openerp.exception. UserError 9 10 , ( ) python, , UserError odoo 9 10.

, , , , .

+1

Source: https://habr.com/ru/post/1679448/


All Articles