From b3fbafadc6c244f922e0465a77497702774aaae8 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Mon, 22 Sep 2025 12:42:35 +0330 Subject: [PATCH] fix weight error in tarnsaction validation serializer --- apps/warehouse/pos/api/v1/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/warehouse/pos/api/v1/serializers.py b/apps/warehouse/pos/api/v1/serializers.py index d7dd0b3..aa0b3f7 100644 --- a/apps/warehouse/pos/api/v1/serializers.py +++ b/apps/warehouse/pos/api/v1/serializers.py @@ -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