From 3a7b1510b328f6c1484dba7c047bcbc85edf1497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20M=C3=A1rton?= Date: Thu, 7 Dec 2023 21:19:48 +0100 Subject: [PATCH] Disable prefetch on part when saving stock items (#6051) Contributes to #6013 --- InvenTree/stock/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 0e11037392..a6b5bf6f38 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -779,6 +779,7 @@ class StockList(APIDownloadMixin, ListCreateDestroyAPIView): }) try: + Part.objects.prefetch_related(None) part = Part.objects.get(pk=data.get('part', None)) except (ValueError, Part.DoesNotExist): raise ValidationError({