feat: handover_revert尝试支持全部撤回

This commit is contained in:
caoqianming 2025-06-26 10:54:32 +08:00
parent a6d53471fc
commit c4cde1c5ea
1 changed files with 6 additions and 6 deletions

View File

@ -918,12 +918,12 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
def handover_revert(handover:Handover):
if handover.submit_time is None:
raise ParseError('该交接单未提交!')
handover_type = handover.type
handover_mtype = handover.mtype
if handover_type in [Handover.H_NORMAL, Handover.H_REPAIR] and handover_mtype == Handover.H_NORMAL:
pass
else:
raise ParseError('该交接单不支持撤销!')
# handover_type = handover.type
# handover_mtype = handover.mtype
# if handover_type in [Handover.H_NORMAL, Handover.H_REPAIR] and handover_mtype == Handover.H_NORMAL:
# pass
# else:
# raise ParseError('该交接单不支持撤销!')
handoverb_qs = Handoverb.objects.filter(handover=handover)
material = handover.material
for item in handoverb_qs: