fix: handover_submit
This commit is contained in:
parent
789ffe53d3
commit
ba8bc4fb72
|
@ -582,12 +582,12 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if wm:
|
||||
attrs['handoverb'] = [{"wm": wm, "count": attrs["count"] }]
|
||||
handoverb = attrs['handoverb']
|
||||
attrs['batch'] = wm.batch
|
||||
elif handoverb:
|
||||
wm: WMaterial = handoverb[0]["wm"]
|
||||
else:
|
||||
raise ParseError('必须指定车间库存')
|
||||
attrs['material'] = wm.material
|
||||
attrs['batch'] = wm.batch
|
||||
attrs['send_dept'] = wm.belong_dept
|
||||
if handoverb[0]["wm"].mgroup:
|
||||
attrs['send_mgroup'] = handoverb[0]["wm"].mgroup
|
||||
|
|
|
@ -580,7 +580,7 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
|
|||
if wm_from is None:
|
||||
raise ParseError('找不到车间库存')
|
||||
|
||||
count_x = wm_from.count - handover.count
|
||||
count_x = wm_from.count - xcount
|
||||
if count_x < 0:
|
||||
raise ParseError('车间库存不足!')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue