update hatching

This commit is contained in:
2026-02-07 15:54:55 +03:30
parent caad850d4c
commit 426f38b9c6

View File

@@ -975,7 +975,7 @@ class HatchingsViewSet(viewsets.ModelViewSet):
hatching.PedigreeName = BREED_STANDARDIZATION[hatching.PedigreeName]
hatching.KillingAve = ave_age
hatching.samasat_discharge_percentage = int(
((hatching.Evacuation + bars_quantity) / hatching.ChickCountSum) * 100)
((hatching.Evacuation + bars_quantity) / hatching.ChickCountSum) * 100) if hatching.ChickCountSum > 0 else 0
hatching.save()
else:
print('تعداد حمل صفر است')