Work around potential caching issue

This commit is contained in:
Raphael Michel
2021-10-19 17:04:28 +02:00
parent 19fb6c8c34
commit 02db07cd25

View File

@@ -1035,7 +1035,7 @@ class Order(LockModel, LoggedModel):
# Count the transactions we already have
current_transaction_count = Counter()
if not is_new:
for t in self.transactions.all():
for t in Transaction.objects.filter(order=self): # do not use related manager, we want to avoid cached data
current_transaction_count[Transaction.key(t)] += t.count
# Count the transactions we'd actually need