From 4a1996c4e920c436e3f1ea33fcc9ca1275962fcb Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 19 Oct 2023 14:05:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=9F=E4=BA=A7=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=B6=E9=80=BB=E8=BE=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/pm/services.py | 4 ++-- apps/pm/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/pm/services.py b/apps/pm/services.py index f5d11499..9771bc5f 100644 --- a/apps/pm/services.py +++ b/apps/pm/services.py @@ -125,11 +125,11 @@ class PmService: 锁定生产任务 """ from apps.wpm.models import Mlog - from apps.wpm.services import mlog_confirm, update_mtask_count + from apps.wpm.services import mlog_confirm, update_mtask for mtask in mtasks: mlogs = Mlog.objects.filter(mtask=mtask) for mlog in mlogs: mlog_confirm(mlog) - update_mtask_count(mtask) + update_mtask(mtask) mtask.state = Mtask.MTASK_DONE mtask.save() diff --git a/apps/pm/views.py b/apps/pm/views.py index f8a68709..be93b2e0 100644 --- a/apps/pm/views.py +++ b/apps/pm/views.py @@ -69,6 +69,6 @@ class MtaskViewSet(CustomModelViewSet): """ ids = request.data.get('ids', []) mtasks = Mtask.objects.filter( - id__in=ids, parent=None, state=Mtask.MTASK_ASSGINED) + id__in=ids, state=Mtask.MTASK_ASSGINED).exclude(parent=None) PmService.mtasks_submit(mtasks) return Response()