fix bug of rancher plan id

This commit is contained in:
2025-09-25 12:44:11 +03:30
parent 8571ef0c68
commit a44be5bbc4
2 changed files with 2 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ def rancher_quota_weight(rancher, inventory_entry: InventoryEntry = None, distri
'rancher',
'livestock_type'
).filter(rancher=rancher, livestock_type=item.livestock_type)
if rancher_plans:
if rancher_plans.exists():
# multiple count of rancher livestock on incentive plan &
# incentive plan quantity by this livestock type
rancher_plan_weight = rancher_plans.first().allowed_quantity * item.quantity_kg