diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 3c3dedca..afaeb86a 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -727,6 +727,8 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, recive_dept = handover.recive_dept batches = [] new_batch = handover.new_batch + if new_batch and mtype != Handover.H_MERGE: + raise ParseError("只有合并时才能提供新批次号") if mtype == Handover.H_MERGE: if new_batch: batches = [new_batch] @@ -763,14 +765,12 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, if wm_from is None: raise ParseError('找不到车间库存') - print(wm_from.count) count_x = wm_from.count - xcount if count_x < 0: raise ParseError('车间库存不足!') else: wm_from.count = count_x wm_from.save() - print(wm_from.count) if need_add: # 开始变动