feat: 改版交接必须为合批操作
This commit is contained in:
parent
e001de9bb6
commit
acf09d0056
|
|
@ -1189,14 +1189,15 @@ class HandoverSerializer(CustomModelSerializer):
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
if "mtype" not in attrs:
|
if "mtype" not in attrs:
|
||||||
attrs['mtype'] = Handover.H_NORMAL
|
attrs['mtype'] = Handover.H_NORMAL
|
||||||
mtype = attrs["mtype"]
|
|
||||||
if 'type' not in attrs:
|
if 'type' not in attrs:
|
||||||
attrs['type'] = Handover.H_NORMAL
|
attrs['type'] = Handover.H_NORMAL
|
||||||
|
|
||||||
if attrs["type"] == Handover.H_CHANGE:
|
if attrs["type"] == Handover.H_CHANGE:
|
||||||
|
attrs["mtype"] = Handover.H_MERGE
|
||||||
if "material_changed" not in attrs:
|
if "material_changed" not in attrs:
|
||||||
raise ParseError("必须指定改版后的物料")
|
raise ParseError("必须指定改版后的物料")
|
||||||
|
|
||||||
if mtype == Handover.H_MERGE:
|
if attrs["mtype"] == Handover.H_MERGE:
|
||||||
new_state = None
|
new_state = None
|
||||||
new_wm:WMaterial = attrs.get("new_wm", None)
|
new_wm:WMaterial = attrs.get("new_wm", None)
|
||||||
if new_wm:
|
if new_wm:
|
||||||
|
|
|
||||||
|
|
@ -720,8 +720,6 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
|
||||||
recive_mgroup = handover.recive_mgroup
|
recive_mgroup = handover.recive_mgroup
|
||||||
recive_dept = handover.recive_dept
|
recive_dept = handover.recive_dept
|
||||||
|
|
||||||
if handover.type == Handover.H_CHANGE:
|
|
||||||
handover.mtype = Handover.H_MERGE
|
|
||||||
new_batch = handover.new_batch
|
new_batch = handover.new_batch
|
||||||
if new_batch and mtype != Handover.H_MERGE:
|
if new_batch and mtype != Handover.H_MERGE:
|
||||||
raise ParseError("只有合并时才能提供新批次号")
|
raise ParseError("只有合并时才能提供新批次号")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue