From 0a2a81582ede69c0f4351f5d57cf3b169b4ca9d3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 5 Oct 2021 22:46:34 +1100 Subject: [PATCH] Handle case where notes are not provided --- InvenTree/stock/serializers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/stock/serializers.py b/InvenTree/stock/serializers.py index e6bbc72dd2..c4fa7fb902 100644 --- a/InvenTree/stock/serializers.py +++ b/InvenTree/stock/serializers.py @@ -475,7 +475,7 @@ class StockCountSerializer(StockAdjustmentSerializer): data = self.validated_data items = data['items'] - notes = data['notes'] + notes = data.get('notes', '') with transaction.atomic(): for item in items: @@ -500,7 +500,7 @@ class StockAddSerializer(StockAdjustmentSerializer): request = self.context['request'] data = self.validated_data - notes = data['notes'] + notes = data.get('notes', '') with transaction.atomic(): for item in data['items']: @@ -525,7 +525,7 @@ class StockRemoveSerializer(StockAdjustmentSerializer): request = self.context['request'] data = self.validated_data - notes = data['notes'] + notes = data.get('notes', '') with transaction.atomic(): for item in data['items']: @@ -575,7 +575,7 @@ class StockTransferSerializer(StockAdjustmentSerializer): data = self.validated_data items = data['items'] - notes = data['notes'] + notes = data.get('notes', '') location = data['location'] with transaction.atomic():