[FIX] project: raise validation error

The ValidationError in Task._check_dates was returned instead of raised
Closes #14393
This commit is contained in:
Sebastián Ramírez
2016-12-05 16:20:59 +01:00
committed by Martin Trigaux
parent 14e5b7fcb6
commit f378a31564
+1 -1
View File
@@ -415,7 +415,7 @@ class Task(models.Model):
@api.constrains('date_start', 'date_end')
def _check_dates(self):
if any(self.filtered(lambda task: task.date_start and task.date_end and task.date_start > task.date_end)):
return ValidationError(_('Error ! Task starting date must be lower than its ending date.'))
raise ValidationError(_('Error ! Task starting date must be lower than its ending date.'))
# Override view according to the company definition
@api.model