fix: update_mb更新物料库存的bug

This commit is contained in:
caoqianming 2024-01-23 18:03:05 +08:00
parent e81acb7aa7
commit 20e209ced2
1 changed files with 3 additions and 1 deletions

View File

@ -63,6 +63,8 @@ class InmService:
else:
raise ParseError('不支持的操作')
material_count = MaterialBatch.objects.filter(
material=material).aggregate(total=Sum('count')).get('total', 0)
material=material).aggregate(total=Sum('count'))['total']
if material_count is None:
material_count = 0
Material.objects.filter(id=material.id).update(
count=material_count)