change map structure of rancher quota weight satistics

This commit is contained in:
2025-09-22 15:51:32 +03:30
parent d528f5e9ac
commit 607a59a900

View File

@@ -70,6 +70,7 @@ def rancher_quota_weight(rancher, inventory_entry: InventoryEntry = None, distri
if animal_type_en not in merged:
merged[animal_type_en] = {
"name_fa": animal_type_fa,
"weight": weight,
"type": item.livestock_type.weight_type
}
@@ -81,6 +82,7 @@ def rancher_quota_weight(rancher, inventory_entry: InventoryEntry = None, distri
"remaining_weight": 20,
"by_type": [{
"name": key,
"name_fa": value['name_fa'],
"weight": value['weight'],
"type": value['type']
} for key, value in merged.items()]