fix: mlogb update 只更新存在的

This commit is contained in:
caoqianming 2023-11-02 17:42:19 +08:00
parent 9c30d43dd0
commit fd13551150
1 changed files with 3 additions and 3 deletions

View File

@ -174,9 +174,9 @@ class MlogSerializer(CustomModelSerializer):
mlogb = Mlogb.objects.get(id=id)
mlogb.count_ok = item['count_ok']
mlogb.save()
elif item['material_out'].id in brotherId_should_list:
Mlogb.objects.create(
mlog=instance, material_out=item['material_out'], count_ok=item['count_ok'])
# elif item['material_out'].id in brotherId_should_list:
# Mlogb.objects.create(
# mlog=instance, material_out=item['material_out'], count_ok=item['count_ok'])
else:
raise ValidationError('缺少产出物信息')
return instance