Ввел логику сделок через партии дополнения
All checks were successful
Deploy MES Core / deploy (push) Successful in 11s
All checks were successful
Deploy MES Core / deploy (push) Successful in 11s
This commit is contained in:
@@ -148,17 +148,17 @@ class ItemAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
@admin.register(WorkItem)
|
@admin.register(WorkItem)
|
||||||
class WorkItemAdmin(admin.ModelAdmin):
|
class WorkItemAdmin(admin.ModelAdmin):
|
||||||
list_display = ('date', 'deal', 'entity', 'operation', 'workshop', 'machine', 'quantity_plan', 'quantity_done', 'status')
|
list_display = ('date', 'deal', 'delivery_batch', 'entity', 'operation', 'workshop', 'machine', 'quantity_plan', 'quantity_done', 'status')
|
||||||
list_filter = ('date', 'status', 'workshop', 'machine', 'operation')
|
list_filter = ('date', 'status', 'workshop', 'machine', 'operation', 'delivery_batch')
|
||||||
search_fields = ('deal__number', 'entity__name', 'entity__drawing_number', 'operation__name', 'operation__code')
|
search_fields = ('deal__number', 'entity__name', 'entity__drawing_number', 'operation__name', 'operation__code')
|
||||||
autocomplete_fields = ('deal', 'entity', 'operation', 'workshop', 'machine')
|
autocomplete_fields = ('deal', 'delivery_batch', 'entity', 'operation', 'workshop', 'machine')
|
||||||
|
|
||||||
|
|
||||||
@admin.register(DealEntityProgress)
|
@admin.register(DealEntityProgress)
|
||||||
class DealEntityProgressAdmin(admin.ModelAdmin):
|
class DealEntityProgressAdmin(admin.ModelAdmin):
|
||||||
list_display = ('deal', 'entity', 'current_seq')
|
list_display = ('deal', 'delivery_batch', 'entity', 'current_seq')
|
||||||
search_fields = ('deal__number', 'entity__name', 'entity__drawing_number')
|
search_fields = ('deal__number', 'entity__name', 'entity__drawing_number')
|
||||||
autocomplete_fields = ('deal', 'entity')
|
autocomplete_fields = ('deal', 'delivery_batch', 'entity')
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Workshop)
|
@admin.register(Workshop)
|
||||||
|
|||||||
@@ -641,7 +641,11 @@ class WeldingPlanAddView(LoginRequiredMixin, View):
|
|||||||
return redirect(next_url if next_url.startswith('/') else 'planning')
|
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)
|
cur = int(cur or 1)
|
||||||
eo = EntityOperation.objects.select_related('operation').filter(entity_id=entity_id, seq=cur).first()
|
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()
|
op = eo.operation if eo else Operation.objects.filter(code='welding').first()
|
||||||
@@ -737,7 +741,11 @@ class PaintingPlanAddView(LoginRequiredMixin, View):
|
|||||||
# Комментарий: покраску можно планировать только на то, что реально сварено.
|
# Комментарий: покраску можно планировать только на то, что реально сварено.
|
||||||
# Доступно к покраске = min(заказано, сварено) − уже в плане покраски.
|
# Доступно к покраске = 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)
|
cur = int(cur or 1)
|
||||||
eo = EntityOperation.objects.select_related('operation').filter(entity_id=entity_id, seq=cur).first()
|
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()
|
op = eo.operation if eo else Operation.objects.filter(code='painting').first()
|
||||||
|
|||||||
Reference in New Issue
Block a user