changeset 3678b9034229 in modules/account_payment_stripe:default
details:
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=3678b9034229
description:
Use clear cache after a commit
issue8449
review251651002
diffstat:
payment.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diffs (39 lines):
diff -r 12b228720492 -r 3678b9034229 payment.py
--- a/payment.py Mon May 06 14:57:35 2019 +0200
+++ b/payment.py Mon Jul 08 21:18:18 2019 +0200
@@ -368,6 +368,8 @@
('company', '=', Transaction().context.get('company')),
])
for payment in payments:
+ # Use clear cache after a commit
+ payment = cls(payment.id)
if (payment.stripe_charge_id
or payment.journal.process_method != 'stripe'
or payment.state != 'processing'):
@@ -447,6 +449,8 @@
('company', '=', Transaction().context.get('company')),
])
for payment in payments:
+ # Use clear cache after a commit
+ payment = cls(payment.id)
if (not payment.stripe_charge_id
or payment.journal.process_method != 'stripe'
or payment.stripe_captured
@@ -828,6 +832,8 @@
],
])
for customer in customers:
+ # Use clear cache after a commit
+ customer = cls(customer.id)
if customer.stripe_customer_id:
continue
customer.lock()
@@ -869,6 +875,8 @@
('stripe_customer_id', '!=', None),
])
for customer in customers:
+ # Use clear cache after a commit
+ customer = cls(customer.id)
assert not customer.active
customer.lock()
try: