diff --git a/apps/inm/services.py b/apps/inm/services.py index 6a52bca7..d40768fe 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -167,10 +167,10 @@ def daoru_mb(path: str): process=process, 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()} ) - InmService.cal_mat_count(material) + cal_material_count([material.id]) # if not is_created: # mb.count += count # mb.save()