ordem add produtos na comanda

This commit is contained in:
2025-01-07 20:00:06 -03:00
parent b2641691fe
commit 6633110140
8 changed files with 37 additions and 23 deletions

View File

@@ -8,7 +8,11 @@ from typePay.models import TypePay
def listProduct(request, comanda_id):
product = request.GET.get("search-product")
products = Product.objects.filter(name__icontains=product)
allProducts = Product.objects.filter(name__icontains=product)
products = []
for p in allProducts:
if p.active == True:
products.append(p)
return render(request, "htmx_components/htmx_list_products.html", {"products": products,'comanda_id':comanda_id})
def addProduct(request, product_id, comanda_id):