title: @api.constrains is not working properly
body: <p>In the 'project.project' model I wrote a function to validate 'start Date' and 'end date' for this I used onchange function.The function is working and giving warning but record is creating. Actually if there is any error means record cannot be saved because I am using @api.constrains below is my code.</p>
  
  <p>py.code:</p>
  
  <pre class="lang-py prettyprint-override"><code>@api.onchange('date','date_start')
  @api.constrains('date','date_start')
  def cheking_field_date(self):
      self.t1 = self.date_start 
      self.t2 = self.date
      if self.t2 == False:
          pass
      else:   
          if str(self.t1) &gt; str(self.t2):
              raise Warning('The Deadline Date is Invalid')
          else:
              pass  
  </code></pre>
  
  <p>But When I was Editing the record if any change in date field means than everything is fine(i.e. validation problem in 'start date' and 'end date').At that time the record is not saving.Why this type problem is coming can any one help me please.</p>