Check is date start
This commit is contained in:
parent
0585672d52
commit
e26e6fd1c7
@ -75,6 +75,13 @@ class Event(models.Model):
|
||||
raise ValidationError(
|
||||
_('Date most be supperior to to start date'))
|
||||
|
||||
@api.constrains('date_start')
|
||||
def _check_date_start(self):
|
||||
"""Test si la modification de la date de fin n'est pas anterieur à la date de début"""
|
||||
if self.date_end < self.date_start:
|
||||
raise ValidationError(
|
||||
_('Date most be inferior to to end date'))
|
||||
|
||||
|
||||
@api.depends('date_start', 'date_end')
|
||||
def _compute_duration(self):
|
||||
|
Loading…
Reference in New Issue
Block a user