[FIX] odex_benefit : fix datetime bug
This commit is contained in:
parent
c83c25e086
commit
ab9c713675
|
|
@ -645,7 +645,7 @@ class ServiceRequest(models.Model):
|
|||
else restoration_date + relativedelta(years=interval)
|
||||
)
|
||||
|
||||
if rec.date < next_allowed_restoration_date:
|
||||
if rec.date.date() < next_allowed_restoration_date:
|
||||
raise ValidationError(_(
|
||||
"You cannot request this service together with 'home_restoration' within the same recurrence period."
|
||||
))
|
||||
|
|
@ -738,7 +738,7 @@ class ServiceRequest(models.Model):
|
|||
if isinstance(next_allowed_date, datetime):
|
||||
next_allowed_date = next_allowed_date.date()
|
||||
|
||||
if rec.date < next_allowed_date:
|
||||
if rec.date.date() < next_allowed_date:
|
||||
raise ValidationError(_(
|
||||
"You can only request this service again after %s."
|
||||
) % next_allowed_date.strftime('%Y-%m-%d'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue