From 061e381f73faf1e90814d350a45ab7b44f31f7dc Mon Sep 17 00:00:00 2001 From: Kevin Rosales Date: Thu, 2 Oct 2025 22:02:30 -0600 Subject: [PATCH] modifique crear_partidas --- api/customs/tasks/auditoria.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/customs/tasks/auditoria.py b/api/customs/tasks/auditoria.py index 50ce843..0ba713f 100644 --- a/api/customs/tasks/auditoria.py +++ b/api/customs/tasks/auditoria.py @@ -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):