Ввел логику сделок через партии дополнения
All checks were successful
Deploy MES Core / deploy (push) Successful in 11s

This commit is contained in:
2026-04-22 08:41:29 +03:00
parent 6da7b775c7
commit da8ef32769
2 changed files with 15 additions and 7 deletions

View File

@@ -641,7 +641,11 @@ class WeldingPlanAddView(LoginRequiredMixin, View):
return redirect(next_url if next_url.startswith('/') else 'planning')
# Комментарий: берём текущую операцию по маршруту детали/сборки.
cur = DealEntityProgress.objects.filter(deal_id=deal_id, entity_id=entity_id).values_list('current_seq', flat=True).first()
cur = (
DealEntityProgress.objects.filter(deal_id=deal_id, delivery_batch_id__isnull=True, entity_id=entity_id)
.values_list('current_seq', flat=True)
.first()
)
cur = int(cur or 1)
eo = EntityOperation.objects.select_related('operation').filter(entity_id=entity_id, seq=cur).first()
op = eo.operation if eo else Operation.objects.filter(code='welding').first()
@@ -737,7 +741,11 @@ class PaintingPlanAddView(LoginRequiredMixin, View):
# Комментарий: покраску можно планировать только на то, что реально сварено.
# Доступно к покраске = min(заказано, сварено) уже в плане покраски.
# Комментарий: берём текущую операцию по маршруту детали/сборки.
cur = DealEntityProgress.objects.filter(deal_id=deal_id, entity_id=entity_id).values_list('current_seq', flat=True).first()
cur = (
DealEntityProgress.objects.filter(deal_id=deal_id, delivery_batch_id__isnull=True, entity_id=entity_id)
.values_list('current_seq', flat=True)
.first()
)
cur = int(cur or 1)
eo = EntityOperation.objects.select_related('operation').filter(entity_id=entity_id, seq=cur).first()
op = eo.operation if eo else Operation.objects.filter(code='painting').first()