[FIX] odex_benefit : fix datetime bug

This commit is contained in:
younes 2025-10-29 15:50:38 +01:00
parent c83c25e086
commit ab9c713675
1 changed files with 2 additions and 2 deletions

View File

@ -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'))