diff --git a/apps/product/management/commands/check_serial_number.py b/apps/product/management/commands/check_serial_number.py index 75d1a693..d9caf69a 100644 --- a/apps/product/management/commands/check_serial_number.py +++ b/apps/product/management/commands/check_serial_number.py @@ -12,6 +12,7 @@ class Command(BaseCommand): tags = Tag.objects.filter(category=category, products__isnull=False) for tag in tqdm(tags, desc='Update serial number for product'): tag.products.all().update(serial_number=tag.value) + tag.products.clear() self.stdout.write(self.style.WARNING(f'Check serial number product end.'))