Odoo 11.0 make field unique

岁酱吖の 提交于 2019-12-11 12:47:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!