NOT NULL, UNIQUE, and CHEK 🛡️ Avoid Inconsistencies! Restrict Values ​​with _sql_constraints in Odoo

Опубликовано: 26 Сентябрь 2026
на канале: Josuhe Uh
2,447
52

In this video, I explain what SQL Constraints are used for in Odoo. I also show you the correct way to declare the SQL constraint with the _sql_constraints attribute. I show you with a practical example how to use IS NOT NULL, UNIQUE, and CHECK to restrict values ​​in fields in Odoo.

▶ Odoo Implementations: https://implementaodoo.tohsoluciones....
🎖️ YouTube Membership:    / @jos.uh.e  
▶ Patreon Membership:   / josuhe  
▶ FREE Odoo Development Course 🎓:    • Curso de Programación Odoo: Código python ...  

🎨 Want something more customized? Want to train your team? Contact me and we'll talk...

https://ko-fi.com/josuheuh/commissions

🎓 Free Odoo External API Course:

   • Curso uso de la ⚙️ API Externa de Odoo | O...  

🌐 Easily connect through the Odoo API using this script 👇:

https://ko-fi.com/s/0466aa2700

☕️ Support this channel with a coffee:

https://ko-fi.com/josuheuh

00:00 Introduction
00:09 What are they and why use them?
00:55 Declaration: SQL Constraints
03:13 Practical Example: _sql_constraints
05:09 Operation: SQL Constraint
07:12 Querying SQL Constraints from Odoo