Fabio Tielen
Fabio Tielen

Reputation: 23

Odoo 11.0 make field unique

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

Answers (1)

Navi
Navi

Reputation: 1052

_sql_constraints = [
         ('Any_name', 'unique (your_field_name)','Your message!')]

Upvotes: 6

Related Questions