fix: handover_submit针对混料特殊处理的bug2
This commit is contained in:
parent
3ddb050330
commit
2addfc8433
|
@ -282,6 +282,7 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
|
||||||
return
|
return
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
need_add = True
|
need_add = True
|
||||||
|
wm_from_need_delete = False
|
||||||
material = handover.material
|
material = handover.material
|
||||||
batch = handover.batch
|
batch = handover.batch
|
||||||
try:
|
try:
|
||||||
|
@ -295,7 +296,7 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
|
||||||
if count_x < 0:
|
if count_x < 0:
|
||||||
raise ParseError('车间库存不足!')
|
raise ParseError('车间库存不足!')
|
||||||
elif count_x == 0:
|
elif count_x == 0:
|
||||||
wm_from.delete()
|
wm_from_need_delete = True
|
||||||
else:
|
else:
|
||||||
wm_from.count = count_x
|
wm_from.count = count_x
|
||||||
wm_from.save()
|
wm_from.save()
|
||||||
|
@ -309,3 +310,5 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
|
||||||
handover.submit_user = user
|
handover.submit_user = user
|
||||||
handover.submit_time = now
|
handover.submit_time = now
|
||||||
handover.save()
|
handover.save()
|
||||||
|
if wm_from_need_delete:
|
||||||
|
wm_from.delete()
|
||||||
|
|
Loading…
Reference in New Issue