fix - edi inventory entry

This commit is contained in:
2025-12-10 16:28:14 +03:30
parent b9a6c1f4d1
commit 1a44ce9978

View File

@@ -58,7 +58,9 @@ class InventoryEntrySerializer(serializers.ModelSerializer):
status.HTTP_403_FORBIDDEN status.HTTP_403_FORBIDDEN
) )
elif self.instance.weight != 0: elif self.instance.weight != 0:
if total_entered_weight - self.instance.weight + attrs['weight'] > remaining_weight_to_enter: if total_entered_weight - self.instance.weight + attrs[
'weight'] > remaining_weight_to_enter + total_entered_weight:
print(total_entered_weight, self.instance.weight)
raise WareHouseException( raise WareHouseException(
"وزن وارد شده برای ورود به انبار نباید از باقیمانده سهمیه بیشتر باشد", # noqa "وزن وارد شده برای ورود به انبار نباید از باقیمانده سهمیه بیشتر باشد", # noqa
status.HTTP_403_FORBIDDEN status.HTTP_403_FORBIDDEN