feat: mlogbin的编辑与mlogbout的联动

This commit is contained in:
caoqianming 2025-06-16 17:42:43 +08:00
parent 95b10371b9
commit 1366f432ee
1 changed files with 12 additions and 10 deletions

View File

@ -789,7 +789,9 @@ class MlogbInUpdateSerializer(CustomModelSerializer):
if mlogb_defect_objects:
MlogbDefect.objects.bulk_create(mlogb_defect_objects)
# 只有普通工序的才可联动
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:
mlogbout_qs = Mlogb.objects.filter(mlog=ins.mlog, mlogb_from=ins)
if mlogbout_qs.count() == 1: