fix bug of inventory entry - fix weight of quotas
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user