fix bug of inventory entry - fix weight of quotas

This commit is contained in:
2025-08-09 16:15:37 +03:30
parent 365362b739
commit 92a5d3a2eb
10 changed files with 181 additions and 32 deletions

View File

@@ -20,7 +20,9 @@ from crum import get_current_user
def recalculate_remaining_amount(quota):
""" calculate remaining weight from distribution """
total_distributed = quota.distributions_assigned.aggregate(
total_distributed = quota.distributions_assigned.filter(
parent_distribution__isnull=True,
).aggregate(
total=Sum('weight')
)['total'] or 0