fix: daoru_mb cal_material bug

This commit is contained in:
caoqianming 2024-07-09 16:16:32 +08:00
parent 6754b668bc
commit 4c93bb98de
1 changed files with 2 additions and 2 deletions

View File

@ -167,10 +167,10 @@ def daoru_mb(path: str):
process=process, process=process,
defaults={"type": type, "name": name, "specification": specification, "model": model, "process": process, "number": ranstr(6), "id": idWorker.get_id()}, defaults={"type": type, "name": name, "specification": specification, "model": model, "process": process, "number": ranstr(6), "id": idWorker.get_id()},
) )
mb, is_created = MaterialBatch.objects.get_or_create( MaterialBatch.objects.get_or_create(
material=material, batch=batch, warehouse=warehouse, defaults={"material": material, "batch": batch, "warehouse": warehouse, "count": count, "id": idWorker.get_id()} material=material, batch=batch, warehouse=warehouse, defaults={"material": material, "batch": batch, "warehouse": warehouse, "count": count, "id": idWorker.get_id()}
) )
InmService.cal_mat_count(material) cal_material_count([material.id])
# if not is_created: # if not is_created:
# mb.count += count # mb.count += count
# mb.save() # mb.save()