问题
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
回答1:
_sql_constraints = [
('Any_name', 'unique (your_field_name)','Your message!')]
来源:https://stackoverflow.com/questions/47843819/odoo-11-0-make-field-unique