how to handle unique field in odoo website.when submitting form getting internal server error due to unique field in custom view odoo v13?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
1198
Views
Hi, Akshay
In order to handle unique field error. You can add try except in your controller like below,
from psycopg2 import IntegrityError
from odoo.exceptions import ValidationError
def yourMethod():
try:
#YourDefination
exceptValidationError as e:
print("Validation Error")
exceptIntegrityError as e:
print("Integrity Error")
Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up