diff --git a/apps/wpm/services.py b/apps/wpm/services.py index d24b7112..6d2742d1 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -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