modifique crear_partidas

This commit is contained in:
2025-10-02 22:02:30 -06:00
parent 466e12e623
commit 061e381f73

View File

@@ -90,7 +90,14 @@ def crear_partidas(organizacion_id):
for pedimento in pedimentos:
crear_partidas_por_pedimento(pedimento.id)
if pedimento.numero_partidas > pedimento.partidas.count():
for i in range(1, pedimento.numero_partidas + 1):
from api.customs.models import Partida
Partida.objects.get_or_create(
pedimento=pedimento,
numero_partida=i,
organizacion_id=organizacion_id
)
@shared_task
def crear_partidas_por_pedimento(pedimento_id):