fix: scope inferred work-order tasks to the current work order
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

Prevent service-record inference from pulling tasks from other work orders
that share the same vehicle. This keeps task-service-context, service
reports, and related work-order widgets isolated to the selected nalog.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-08-31 08:32:41 +02:00
parent 2826ee9bab
commit 1e68c663f2
2 changed files with 33 additions and 1 deletions

View File

@@ -155,6 +155,7 @@ def _work_order_related_tasks_queryset(work_order):
vehicle_id=work_order.vehicle_id,
task_id__isnull=False,
task__is_active=True,
task__work_order=work_order,
).values_list('task_id', flat=True)
)
task_ids = list({*direct_task_ids, *inferred_task_ids})