From acf09d005653e776c49828cc0e8720e62ae57137 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 11 Nov 2025 09:35:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B9=E7=89=88=E4=BA=A4=E6=8E=A5?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E4=B8=BA=E5=90=88=E6=89=B9=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 5 +++-- apps/wpm/services.py | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 8143d366..107d0909 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -1189,14 +1189,15 @@ class HandoverSerializer(CustomModelSerializer): def validate(self, attrs): if "mtype" not in attrs: attrs['mtype'] = Handover.H_NORMAL - mtype = attrs["mtype"] if 'type' not in attrs: attrs['type'] = Handover.H_NORMAL + if attrs["type"] == Handover.H_CHANGE: + attrs["mtype"] = Handover.H_MERGE if "material_changed" not in attrs: raise ParseError("必须指定改版后的物料") - if mtype == Handover.H_MERGE: + if attrs["mtype"] == Handover.H_MERGE: new_state = None new_wm:WMaterial = attrs.get("new_wm", None) if new_wm: diff --git a/apps/wpm/services.py b/apps/wpm/services.py index f6d1a27c..7bb9a5d5 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -720,8 +720,6 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, recive_mgroup = handover.recive_mgroup recive_dept = handover.recive_dept - if handover.type == Handover.H_CHANGE: - handover.mtype = Handover.H_MERGE new_batch = handover.new_batch if new_batch and mtype != Handover.H_MERGE: raise ParseError("只有合并时才能提供新批次号")