fix: bug ao add product in comanda

This commit is contained in:
2025-03-26 19:50:03 -03:00
parent a2c1c2bcf0
commit ef24e3f3bc
6 changed files with 10 additions and 4 deletions

View File

@@ -86,7 +86,8 @@ def addProduct(request, product_id, comanda_id):
'id':order.id, 'id':order.id,
'speak': f'Novo pedido! {product.name}, para {comanda.name}.' 'speak': f'Novo pedido! {product.name}, para {comanda.name}.'
}) })
asyncio.run(enviar_mensagem(msg))
# asyncio.run(enviar_mensagem(msg))
consumo = ProductComanda.objects.filter(comanda=comanda_id) consumo = ProductComanda.objects.filter(comanda=comanda_id)
valores = somar(consumo,comanda) valores = somar(consumo,comanda)

View File

@@ -59,8 +59,11 @@ def has_group(user, group_name):
@register.filter(name='obsOrder') @register.filter(name='obsOrder')
def obsOrder(id): def obsOrder(id):
productComanda_obj = ProductComanda.objects.get(pk=id) try:
order = Order.objects.get(productComanda=productComanda_obj) productComanda_obj = ProductComanda.objects.get(pk=id)
return order.obs order = Order.objects.get(productComanda=productComanda_obj)
return order.obs
except:
return ''

Binary file not shown.

View File

@@ -1,4 +1,6 @@
{% load static %} {% load static %}
{% load custom_filter_tag %}
<tr> <tr>
<th style="text-align: left;"><b>Produto</b></th> <th style="text-align: left;"><b>Produto</b></th>