mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle case where notes are not provided
This commit is contained in:
parent
102f886d81
commit
0a2a81582e
@ -475,7 +475,7 @@ class StockCountSerializer(StockAdjustmentSerializer):
|
|||||||
|
|
||||||
data = self.validated_data
|
data = self.validated_data
|
||||||
items = data['items']
|
items = data['items']
|
||||||
notes = data['notes']
|
notes = data.get('notes', '')
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
for item in items:
|
for item in items:
|
||||||
@ -500,7 +500,7 @@ class StockAddSerializer(StockAdjustmentSerializer):
|
|||||||
request = self.context['request']
|
request = self.context['request']
|
||||||
|
|
||||||
data = self.validated_data
|
data = self.validated_data
|
||||||
notes = data['notes']
|
notes = data.get('notes', '')
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
for item in data['items']:
|
for item in data['items']:
|
||||||
@ -525,7 +525,7 @@ class StockRemoveSerializer(StockAdjustmentSerializer):
|
|||||||
request = self.context['request']
|
request = self.context['request']
|
||||||
|
|
||||||
data = self.validated_data
|
data = self.validated_data
|
||||||
notes = data['notes']
|
notes = data.get('notes', '')
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
for item in data['items']:
|
for item in data['items']:
|
||||||
@ -575,7 +575,7 @@ class StockTransferSerializer(StockAdjustmentSerializer):
|
|||||||
data = self.validated_data
|
data = self.validated_data
|
||||||
|
|
||||||
items = data['items']
|
items = data['items']
|
||||||
notes = data['notes']
|
notes = data.get('notes', '')
|
||||||
location = data['location']
|
location = data['location']
|
||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
|
Loading…
Reference in New Issue
Block a user