details:   https://code.tryton.org/tryton/commit/a92bf35caac0
branch:    7.6
user:      Cédric Krier <[email protected]>
date:      Thu Jan 15 15:22:09 2026 +0100
description:
        Lock the sale being processed for Shopify

        Closes #14500
        (grafted from 0d96a4b8d2ad4a7fd7ea8be06202afeee3d6df19)
diffstat:

 modules/web_shop_shopify/sale.py |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r b471b8fba667 -r a92bf35caac0 modules/web_shop_shopify/sale.py
--- a/modules/web_shop_shopify/sale.py  Thu Jan 15 14:41:53 2026 +0100
+++ b/modules/web_shop_shopify/sale.py  Thu Jan 15 15:22:09 2026 +0100
@@ -224,6 +224,7 @@
         """
         pool = Pool()
         Payment = pool.get('account.payment')
+        self.lock()
         with self.web_shop.shopify_session():
             for shipment in self.shipments:
                 fulfillment = shipment.get_shopify(self)
@@ -236,6 +237,9 @@
                                     fulfillment.errors.full_messages())))
                     shipment.set_shopify_identifier(self, fulfillment.id)
                     Transaction().commit()
+                    # Start a new transaction as commit release the lock
+                    self.__class__.__queue__._process_shopify(self)
+                    return
                 elif shipment.state == 'cancelled':
                     fulfillment_id = shipment.get_shopify_identifier(self)
                     if fulfillment_id:

Reply via email to