details: https://code.tryton.org/tryton/commit/90fa66afe510
branch: default
user: Cédric Krier <[email protected]>
date: Wed Nov 18 15:29:55 2026 +0100
description:
Ignore children transaction with non successful parent when updating
Shopify transaction
Closes #15246
diffstat:
modules/web_shop_shopify/account.py | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diffs (44 lines):
diff -r 8078bb2ec9ae -r 90fa66afe510 modules/web_shop_shopify/account.py
--- a/modules/web_shop_shopify/account.py Fri Nov 27 15:25:24 2026 +0100
+++ b/modules/web_shop_shopify/account.py Wed Nov 18 15:29:55 2026 +0100
@@ -112,22 +112,34 @@
captured[payment] += Decimal(
transaction['amountSet']['presentmentMoney']['amount'])
elif transaction['kind'] == 'CAPTURE':
- payment = id2payments[
- gid2id(transaction['parentTransaction']['id'])]
+ try:
+ payment = id2payments[
+ gid2id(transaction['parentTransaction']['id'])]
+ except KeyError:
+ # the parent transaction was not successful
+ continue
id2payments[gid2id(transaction['id'])] = payment
captured[payment] += Decimal(
transaction['amountSet']['presentmentMoney']['amount'])
elif transaction['kind'] == 'VOID':
- payment = id2payments[
- gid2id(transaction['parentTransaction']['id'])]
+ try:
+ payment = id2payments[
+ gid2id(transaction['parentTransaction']['id'])]
+ except KeyError:
+ # the parent transaction was not successful
+ continue
voided[payment] += Decimal(
transaction['amountSet']['presentmentMoney']['amount'])
elif transaction['kind'] == 'REFUND':
if not transaction['parentTransaction']:
payment = id2payments[gid2id(transaction['id'])]
else:
- payment = id2payments[
- gid2id(transaction['parentTransaction']['id'])]
+ try:
+ payment = id2payments[
+ gid2id(transaction['parentTransaction']['id'])]
+ except KeyError:
+ # the parent transaction was not successful
+ continue
captured[payment] -= Decimal(
transaction['amountSet']['presentmentMoney']['amount'])
refunded[payment] += Decimal(