This question has been flagged

Odoo 14 EE 

How to create a unique field in product.product 


Avatar
Discard
Best Answer

Hi,

  you can use SQL constraints option  to specify rules for the data in a table.

If there is any violation between the constraint and the data action, the action is aborted by the constraint.


 _sql_constraints = [

        ('name_uniq', 'unique (name)', "Tag already exists!"),

    ]

refer

Avatar
Discard