fix - rancher statistics by herd

This commit is contained in:
2025-11-12 10:54:35 +03:30
parent 9d8dcc786d
commit 212f7a3859

View File

@@ -3,7 +3,7 @@ from rest_framework import serializers
from rest_framework.exceptions import APIException
from apps.core.models import SystemConfig
from apps.herd.services.services import get_rancher_statistics, rancher_quota_weight
from apps.herd.services.services import rancher_quota_weight, get_rancher_statistic_by_herd
from apps.pos_device.services.services import pos_organizations_sharing_information
from apps.product import models as product_models
from apps.product.exceptions import (
@@ -130,7 +130,7 @@ class QuotaDistributionSerializer(serializers.ModelSerializer):
if 'rancher' in self.context.keys():
# rancher herd & live stock statistics
livestock_counts_list, livestock_counts_dict = get_rancher_statistics(rancher)
livestock_counts_list, livestock_counts_dict = get_rancher_statistic_by_herd(rancher)
representation['rancher_statistics'] = livestock_counts_list
# rancher live stock statistics by quota distributions