hie...I am new in openerp. Here is my code. When condition is met properly, it throws exception which is correct. But when condition is not met, it still throws exception. How??????
def _check_resign_date(self,cr,uid,ids,context=None):
for rec in self.browse(cr,uid,ids):
if rec.status == 'resign':
if rec.resign_date > rec.separation_date:
raise osv.except_osv(('Alert!'),('Resignation date should not be greater than Separation Date.'))
elif rec.status == 'transfer':
if rec.transfer_date > rec.separation_date:
raise osv.except_osv(('Alert!'),('Transfer date should not be greater than Separation Date.'))
return True
_constraints = [ (_check_resign_date,'a',['id']), ]