feat: gerenciamento quantidade product

This commit is contained in:
2025-07-18 18:24:21 -03:00
parent 672af857a0
commit a20fa6d583
21 changed files with 63 additions and 41 deletions

View File

@@ -45,6 +45,8 @@ def removeProductComanda(request, productComanda_id):
if product_comanda.product.cuisine == True:
order = Order.objects.get(productComanda=product_comanda)
product_comanda.delete()
Product.addStock(Product.objects.get(id=product_comanda.product.id), 1)
msg = JsonResponse({
'type': 'broadcast',
'message': 'Atenção! Pedido cancelado',
@@ -59,6 +61,7 @@ def removeProductComanda(request, productComanda_id):
valores = somar(consumo,comanda)
else:
product_comanda.delete()
Product.addStock(Product.objects.get(id=product_comanda.product.id), 1)
consumo = ProductComanda.objects.filter(comanda=comanda)
valores = somar(consumo,comanda)