fix: handover submit时更新bug
This commit is contained in:
parent
6efcf19716
commit
cbe516ccf5
|
|
@ -511,11 +511,11 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
|
||||||
wm_from.save()
|
wm_from.save()
|
||||||
if need_add:
|
if need_add:
|
||||||
if handover.recive_mgroup:
|
if handover.recive_mgroup:
|
||||||
# 处理返工交接
|
|
||||||
if handover.type == Handover.H_NORMAL:
|
if handover.type == Handover.H_NORMAL:
|
||||||
wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, mgroup=handover.recive_mgroup, defaults={
|
wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, mgroup=handover.recive_mgroup, material_origin=None, defaults={
|
||||||
'batch': batch, 'material': material, 'mgroup': handover.recive_mgroup, 'belong_dept': handover.recive_dept
|
'batch': batch, 'material': material, 'mgroup': handover.recive_mgroup, 'belong_dept': handover.recive_dept
|
||||||
})
|
})
|
||||||
|
# 处理返工交接
|
||||||
elif handover.type == Handover.H_REPAIR:
|
elif handover.type == Handover.H_REPAIR:
|
||||||
wm_to, _ = WMaterial.objects.get_or_create(
|
wm_to, _ = WMaterial.objects.get_or_create(
|
||||||
batch=batch,
|
batch=batch,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue