fix: MlogbInUpdateSerializer 联动count_use 和 count_real

This commit is contained in:
caoqianming 2025-09-02 09:10:52 +08:00
parent 67f7afd3fc
commit 81561b5238
1 changed files with 3 additions and 4 deletions

View File

@ -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:
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()