Constrain in Odoo

Hello Odooers, Odoogig and Odoo Lovers,

In this Odoo Techniacl Tutorial I would like to explain how to use @api Constrain in Odoo

  • In general term Constrain means force to follow some particular action
  • In odoo we use constrain to put some kind of restriction
  • For example, citizen under 18 age are not allowed for voting. So putting this type of restriction we use constrains on some field in odoo
  • In above case we must use constrain on age field
  • @api.constrains decorator is used to put restriction on field
 #odoo #odoo12.0 #constrain #alert #warning #learnodoo


  • So whenever you enter age less than 18 and try to save the record  system will restrict you with error message as shown in above example



We’d Love to Hear from You! We are happy to answer any questions, you have regarding My Training.

Mail :

Skype : mayur_maheshwari1

What’s app : +919924542042

1 thought on “How to use Constrain in Odoo


Leave a Reply

Your email address will not be published. Required fields are marked *