feat: automatic product archiving

This commit is contained in:
imperosol
2025-09-14 01:36:46 +02:00
parent b767079c5a
commit 5274f1f0f0
6 changed files with 164 additions and 22 deletions

13
counter/tasks.py Normal file
View File

@@ -0,0 +1,13 @@
# Create your tasks here
from celery import shared_task
from counter.models import Product
@shared_task
def archive_product(product_id):
product = Product.objects.get(id=product_id)
product.archived = True
product.save()
product.counters.clear()