采购入库bug

This commit is contained in:
caoqianming 2021-10-28 13:44:57 +08:00
parent 1ab3b4eb7a
commit b6d97a1be1
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ def update_by_fifodetail(sender, instance, created, **kwargs):
defaults={'material':material, 'warehouse':warehouse, 'count':0})
o1.count = o1.count + instance.count
o1.save()
o2 = MaterialBatch.objects.get_or_create(material=material, warehouse=warehouse, batch=instance.batch,\
o2, _ = MaterialBatch.objects.get_or_create(material=material, warehouse=warehouse, batch=instance.batch,\
defaults={'material':material, 'warehouse':warehouse, 'count':0, 'batch':instance.batch})
o2.save()
material.count = material.count + 1