feat: 车间库存不足提示更准确

This commit is contained in:
caoqianming 2025-05-16 08:55:31 +08:00
parent 3075d8ab8e
commit 5a08b5d22c
1 changed files with 2 additions and 2 deletions

View File

@ -773,11 +773,11 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime,
batches.append(batch) batches.append(batch)
if wm_from is None: if wm_from is None:
raise ParseError('找不到车间库存') raise ParseError(f'{wm_from.batch} 找不到车间库存')
count_x = wm_from.count - xcount count_x = wm_from.count - xcount
if count_x < 0: if count_x < 0:
raise ParseError('车间库存不足!') raise ParseError(f'{wm_from.batch} 车间库存不足!')
else: else:
wm_from.count = count_x wm_from.count = count_x
wm_from.save() wm_from.save()