Hello Community,
What is the diffrence between ValidationError and UserError when we want to show an error message ?
Thanks.
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.
Skapa ett konto idag för att ta del av exklusiva funktioner och engagera dig i vår fantastiska community!
Registrera dig| Relaterade inlägg | Svar | Vyer | Verksamhet | |
|---|---|---|---|---|
|
2
juli 22
|
10041 | |||
|
0
sep. 24
|
2541 | |||
|
1
mars 15
|
11773 | |||
|
1
nov. 22
|
8881 | |||
|
0
juni 21
|
7535 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
Hi,
You can just go through this file : https://github.com/odoo/odoo/blob/10.0/odoo/exceptions.py#L37