feat: abre modal de informações do status da order ao clicar sobre o nome do product na viewcomanda

This commit is contained in:
2025-06-27 17:14:08 -03:00
parent 1ef263d033
commit c8c3653bf8
12 changed files with 72 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
from django.db import models
from django.utils.formats import date_format
from products.models import Product
from comandas.models import Comanda, ProductComanda
@@ -16,4 +17,12 @@ class Order(models.Model):
canceled = models.DateTimeField(null=True, blank=True)
def __str__(self):
return f"Pedido {self.id} - Produto: {self.id_product} - Comanda: {self.id_comanda.name}"
status = 'Em espera'
if self.preparing:
status = 'Preparando'
if self.finished:
status = 'Pronto'
if self.delivered:
status = 'Entregue'
return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(self.queue, 'd/m/Y H:i')}"

View File

@@ -23,7 +23,7 @@
<body>
{% block 'body' %}
<div class="container">
<h1>Pedidos cozinha</h1>
<h1 id="title">Pedidos cozinha</h1>
<div class="kanban-board">
{% csrf_token %}
<div class="column">