title: How to make a constraint on a fields
body: <p>I want to put a control check on a field (TIN) so that everytime I create a new customer, the TIN should be unique. If another customer has that TIN, an error message must show up.
  I tried this syntax: </p>
  
  <pre><code>_sql_constraints=[('uniq_vat', 'UNIQUE(self.env.vat)', 
  'It already exists another company with the same TIN!')]
  </code></pre>
  
  <p>I'm using odoo 10.</p>