diff --git a/apps/establishment/management/commands/update_employee.py b/apps/establishment/management/commands/update_employee.py index 888c121e..e6d00cc8 100644 --- a/apps/establishment/management/commands/update_employee.py +++ b/apps/establishment/management/commands/update_employee.py @@ -33,7 +33,7 @@ class Command(BaseCommand): for e in tqdm(self.employees_sql()): empl = Employee.objects.filter(old_id=e.profile_id).update(name=e.name) - EstablishmentEmployee.objects.filter(from_date__isnull=True, old_id__isnull=True)\ + EstablishmentEmployee.objects.filter(from_date__isnull=True, old_id__isnull=False)\ .update(from_date=timezone.now()-timezone.timedelta(days=1)) self.stdout.write(self.style.WARNING(f'Update employee name objects.'))