UNPSJB / TallerChaPin

Taller de Chapa y Pintura

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'rounded-pill' muestra cantidad incorrecta en los detalles sin asignar

ramirocanario1 opened this issue · comments

Al mostrar las tarjetas en el template detalleordendetrabajo_list.html hay:
{% if detalle_orden.se_debe_mostrar %} (línea 5)

Esto es para no mostrar trabajos que se deben realizar sobre vehículos que aún no registraron su ingreso al taller. El 'rounded-pill' muestra la cantidad total de detalles sin asignar, sin considerar el if de la línea 5.
image

La solución sería modificar directamente el método que obtiene la lista, y eliminar el if de la línea 5.

El método que obtiene la lista es el siguiente (/ordenes/models.py):

def sin_asignar(self):
    no_tiene_empleado = models.Q(empleado__isnull=True)
    qs = self.filter(no_tiene_empleado).order_by('orden__turno')
    return qs