fix weight error in tarnsaction validation serializer

This commit is contained in:
2025-09-22 12:42:35 +03:30
parent 19a26b3a14
commit b3fbafadc6

View File

@@ -182,7 +182,7 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
total=models.Sum('weight')
)['total'] or 0
if total_sale_weight + attrs['weight'] > distribution.weight:
if total_sale_weight + item.get('weight') > distribution.weight:
raise DistributionWeightException()
return attrs