Hello Community,
What is the diffrence between ValidationError and UserError when we want to show an error message ?
Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello Community,
What is the diffrence between ValidationError and UserError when we want to show an error message ?
Thanks.
ValidationError is explained very briefly in the source code (linked by Nijas Raphy) like this
class ValidationError(except_orm):
""" Violation of python constraints
Example: When you try to create a new user with a login which already exist in the db."""
def __init__(self, msg):
super(ValidationError, self).__init__(msg)
UserError is not really explained at all, but you can search the source code for examples (directly on github or do a "git grep UserError" if you have the repo locally which I highly recommend) and it will give you an idea.
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
2
juil. 22
|
8254 | ||
|
0
sept. 24
|
1331 | ||
|
1
mars 15
|
10391 | ||
|
1
nov. 22
|
7338 | ||
|
0
juin 21
|
6364 |
Hi,
You can just go through this file : https://github.com/odoo/odoo/blob/10.0/odoo/exceptions.py#L37