Reputation: 23
Can somebody explain how to make a field unique value? Like the invoice number, order number, ... each value must be unique.
I need this for the product internal_reference and contact reference too. I've been checking the parameters for these fields via Odoo Studio app, but I don't see anything how to make them unique.
Thanks
Upvotes: 1
Views: 3115
Reputation: 1052
_sql_constraints = [
('Any_name', 'unique (your_field_name)','Your message!')]
Upvotes: 6