fixed: timezone de orders alterado para exibição utc -3

This commit is contained in:
2025-07-02 10:29:16 -03:00
parent 09c5fd1e98
commit 7c6586bbce
8 changed files with 58 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
from django.db import models
from django.utils.formats import date_format
from datetime import timedelta
from products.models import Product
from comandas.models import Comanda, ProductComanda
@@ -18,6 +19,8 @@ class Order(models.Model):
def __str__(self):
status = 'Em espera'
datetime = self.queue - timedelta(hours=3)
if self.preparing:
status = 'Preparando'
if self.finished:
@@ -25,4 +28,4 @@ class Order(models.Model):
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')}"
return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(datetime, 'd/m/Y H:i')}"