fix: handover_submit针对混料特殊处理的bug3

This commit is contained in:
caoqianming 2024-03-06 22:24:11 +08:00
parent 2addfc8433
commit 779488589a
1 changed files with 2 additions and 2 deletions

View File

@ -301,8 +301,8 @@ def handover_submit(handover: Handover, user: User, now: Union[datetime.datetime
wm_from.count = count_x
wm_from.save()
if need_add:
wm_to, _ = WMaterial.objects.get_or_create(batch=handover.batch, material=handover.material, belong_dept=handover.send_dept, defaults={
'batch': handover.batch, 'material': handover.material, 'belong_dept': handover.send_dept
wm_to, _ = WMaterial.objects.get_or_create(batch=batch, material=material, belong_dept=handover.recive_dept, defaults={
'batch': batch, 'material': material, 'belong_dept': handover.recive_dept
})
wm_to.count = wm_to.count + handover.count
wm_to.count_eweight = handover.count_eweight