feat: Handover正常交接不支持不合格品

This commit is contained in:
caoqianming 2025-01-10 09:40:51 +08:00
parent 2da98efca8
commit c03129ae81
1 changed files with 1 additions and 1 deletions

View File

@ -747,7 +747,7 @@ class HandoverSerializer(CustomModelSerializer):
# raise ParseError(f'第{ind+1}物料与交接部门不一致')
if attrs["material"] != wm.material:
raise ParseError(f'{ind+1}物料与交接物料不一致')
if wm.notok_sign is not None and attrs['type'] in [Handover.H_NORMAL, Handover.H_TEST]:
if (wm.notok_sign or wm.defect) and attrs['type'] in [Handover.H_NORMAL, Handover.H_TEST]:
raise ParseError(f'{ind+1}物料不合格,不能进行正常/检验交接')
if wm.count_xtest is not None:
raise ParseError(f'{ind+1}物料检验中,不能进行交接')