update model hatching

This commit is contained in:
2026-02-07 17:24:05 +03:30
parent 053df2a45a
commit ca2e716fa9

View File

@@ -2533,6 +2533,7 @@ def api_update_poultry_hatching_from_rsi(request):
poultry_name = data.get('UnitName', None)
losses = data.get('Evacuation', 0)
province = data['ProvinceName']
loadingSum = data['loadingSum']
city = data['CityName']
PersonTypeName = data['PersonTypeName']
InteractTypeName = data['InteractTypeName']
@@ -2790,6 +2791,7 @@ def api_update_poultry_hatching_from_rsi(request):
CertId=CertId,
predicate_date=date + timedelta(
days=poultry.killing_ave_age) if poultry.killing_ave_age > 1 else None,
loadingSum=loadingSum
)
hatching.chicken_age = (datetime.datetime.now().date() - hatching.date.date()).days + 1
@@ -2806,6 +2808,7 @@ def api_update_poultry_hatching_from_rsi(request):
last_hatchings.quantity = hatching_quantity
last_hatchings.losses = losses
last_hatchings.PersonTypeName = PersonTypeName
last_hatchings.loadingSum = loadingSum
last_hatchings.InteractTypeName = InteractTypeName
last_hatchings.UnionTypeName = UnionTypeName
last_hatchings.chicken_age = (datetime.datetime.now().date() - last_hatchings.date.date()).days + 1