Odoo helps you to set validations to recordsets with the help of python and model constraints. Mainly there are two ways in which constraints can be set to variants in Odoo. They are python and SQL constraints.
Basically python constraints are set in odoo using the class decorator api.constrains() which takes in the field name as arguments and applies the validation conditions to the fields specified inside the method.
In this video, we'll be discussing how we can apply such constraints to our odoo models and fields.