diff --git a/project/customer/models.py b/project/customer/models.py index fb0e323..bb63013 100644 --- a/project/customer/models.py +++ b/project/customer/models.py @@ -449,8 +449,8 @@ class License(models.Model): max_date_license = License.objects.filter(company=self.company).aggregate(Max('date_to'))['date_to__max'] now_ = datetime.now() - if max_date_license < now_.today(): - max_date_license = now_.today() - timedelta(days=1) + if max_date_license < now_.date(): + max_date_license = now_.date() - timedelta(days=1) self.date_from = max_date_license + relativedelta(days=1) self.date_to = self.date_from + relativedelta(months=self.term, days=-1)