details:   https://code.tryton.org/tryton/commit/3e5f9fe76028
branch:    7.8
user:      Cédric Krier <[email protected]>
date:      Thu Jan 15 17:28:20 2026 +0100
description:
        Round quantity instead of truncate for Shopify fulfillment

        Closes #14502
        (grafted from 61524b93e2e758daa82e7d81f3a66ff64823328e)
diffstat:

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

diffs (21 lines):

diff -r 0eb970609f98 -r 3e5f9fe76028 modules/web_shop_shopify/stock.py
--- a/modules/web_shop_shopify/stock.py Thu Jan 15 15:22:09 2026 +0100
+++ b/modules/web_shop_shopify/stock.py Thu Jan 15 17:28:20 2026 +0100
@@ -200,7 +200,7 @@
             return
         location_id = id2gid('Location', location_id)
         identifier = id2gid('LineItem', self.origin.shopify_identifier)
-        quantity = int(Uom.compute_qty(
+        quantity = round(Uom.compute_qty(
                 self.unit, self.quantity, self.origin.unit))
         for fulfillment_order in fulfillment_orders['nodes']:
             if fulfillment_order['status'] in {'CANCELLED', 'CLOSED'}:
@@ -254,7 +254,7 @@
             ratio = c_quantity / self.origin.quantity
         else:
             ratio = 1
-        quantity = int(sale_line.quantity * ratio)
+        quantity = round(sale_line.quantity * ratio)
         for fulfillment_order in fulfillment_orders['nodes']:
             if (fulfillment_order['assignedLocation']['location']['id']
                     != location_id):

Reply via email to