fix: bug
This commit is contained in:
@@ -176,7 +176,8 @@ class StockMovemendUpdateSerializer(serializers.ModelSerializer):
|
|||||||
instance.comment = validated_data.get('comment', instance.comment)
|
instance.comment = validated_data.get('comment', instance.comment)
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
||||||
movemend_products = validated_data.pop('movemend_products')
|
movemend_products = validated_data.pop('movemend_products', [])
|
||||||
|
if movemend_products:
|
||||||
updated_products = []
|
updated_products = []
|
||||||
for product_data in movemend_products:
|
for product_data in movemend_products:
|
||||||
product = product_data['movemend_product']
|
product = product_data['movemend_product']
|
||||||
@@ -187,4 +188,5 @@ class StockMovemendUpdateSerializer(serializers.ModelSerializer):
|
|||||||
updated_products,
|
updated_products,
|
||||||
fields=['quantity']
|
fields=['quantity']
|
||||||
)
|
)
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
Reference in New Issue
Block a user