Hello Odooers, Odoogig and Odoo Lovers,
In this Odoo Tips Tutorial, I would like to explain how to remove Unique _sql_constraints in Odoo
- If you don’t know what is Unique _sql_constraints and how to add it, then first refer this article
- You can remove Unique _sql_constraints from model by inheriting particular model in odoo
_sql_constraints = [('name_of_field_unique', 'CHECK(1=1)','Error Message')]
_sql_constraints = [('identification_number_unique', 'CHECK(1=1)','This Identification number is already assigned to other employee, please enter another number')]
- So here, CHECK(1=1) will help to bypass the constrain on the field
- Using this way you can remove _sql_constraints from any model
GET IN TOUCH.!
We’d Love to Hear from You! We are happy to answer any questions, you have regarding My Training.
Mail : firstname.lastname@example.org
Skype : mayur_maheshwari1
What’s app : +919924542042