inm 入库bug

This commit is contained in:
caoqianming 2022-02-25 15:36:20 +08:00
parent 82dab392f0
commit 5548776cde
1 changed files with 2 additions and 2 deletions

View File

@ -22,8 +22,8 @@ class InmService:
defaults={'material':material, 'warehouse':warehouse, 'count':0, 'batch':i.batch})
o2.count = o2.count + i.count
o2.save()
iv = Inventory.objects.get_or_create(material=material, warehouse=warehouse, \
iv, _= Inventory.objects.get_or_create(material=material, warehouse=warehouse, \
defaults={'material':material, 'warehouse':warehouse, 'count':0})
iv.count = MaterialBatch.objects.filter(material=material, warehouse=warehouse).count()
iv.save()