changeset 943a29f62a7b in modules/account_payment_stripe:4.4
details:
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=943a29f62a7b
description:
Use clear cache after a commit
issue8449
review251651002
(grafted from 3678b90342290281f4fd42ad78af7b9a5ea17c66)
diffstat:
payment.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (30 lines):
diff -r 05428c138ce5 -r 943a29f62a7b payment.py
--- a/payment.py Mon Jun 10 19:13:08 2019 +0200
+++ b/payment.py Mon Jul 08 21:18:18 2019 +0200
@@ -192,6 +192,8 @@
('stripe_charge_id', '=', None),
])
for payment in payments:
+ # Use clear cache after a commit
+ payment = cls(payment.id)
cls.__lock([payment])
try:
charge = stripe.Charge.create(**payment._charge_parameters())
@@ -359,6 +361,8 @@
],
])
for customer in customers:
+ # Use clear cache after a commit
+ customer = cls(customer.id)
assert not customer.stripe_customer_id
try:
cu = stripe.Customer.create(
@@ -398,6 +402,8 @@
('stripe_customer_id', '!=', None),
])
for customer in customers:
+ # Use clear cache after a commit
+ customer = cls(customer.id)
assert not customer.active
try:
cu = stripe.Customer.retrieve(