fix: handover submit时更新bug

This commit is contained in:
caoqianming 2024-08-01 15:25:16 +08:00
parent 6efcf19716
commit cbe516ccf5
1 changed files with 2 additions and 2 deletions

View File

@ -511,11 +511,11 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
wm_from.save()
if need_add:
if handover.recive_mgroup:
# 处理返工交接
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
})
# 处理返工交接
elif handover.type == Handover.H_REPAIR:
wm_to, _ = WMaterial.objects.get_or_create(
batch=batch,