From 81561b523825c4ea372a60ae448be0b8c5ee6422 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 2 Sep 2025 09:10:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MlogbInUpdateSerializer=20=E8=81=94?= =?UTF-8?q?=E5=8A=A8count=5Fuse=20=E5=92=8C=20count=5Freal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index bfe1df68..faf97ea4 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -824,10 +824,9 @@ class MlogbInUpdateSerializer(CustomModelSerializer): MlogbDefect.objects.bulk_create(mlogb_defect_objects) ins.cal_count_pn_jgqbl(cal_mlog=False) # 只有普通工序的才可联动 - material_out:Material = ins.mlog.material_out - route:Route = mlog.route - if material_out.tracking == Material.MA_TRACKING_BATCH: - if route and route.process and route.process.mtype == Process.PRO_NORMAL: + route:Route = ins.route if ins.route else ins.mlog.route + if route and route.process and route.process.mtype == Process.PRO_NORMAL: + if route.material_out.tracking == Material.MA_TRACKING_BATCH: mlogbout_qs = Mlogb.objects.filter(mlog=ins.mlog, mlogb_from=ins) if mlogbout_qs.count() == 1: mlogbout = mlogbout_qs.first()