The old API defined a unique field as follows:
_sql_constraints = [
('cne_unique', 'unique(cne)', 'cne already exists!')
The new API deprecates this, and recommends to use @api.constrains, but how can I code to check for uniqueness in an efficient way?
this is _constraints which is deprecated (python constraint), not _sql_constraints, see :
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 3/29/15, 3:11 PM|
|Seen: 809 times|
|Last updated: 4/14/16, 3:24 AM|