From 2ce1adfc046d74add365e2bbac676c27a46ef842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 20 Nov 2025 10:10:27 +0100 Subject: [PATCH] Do not prevent to process sale line without product and quantity from Shopify When a line is removed on Shopify, the quantity of the sale line is set to 0 in Tryton because Shopify refund the line. So such line without product must not prevent to process the sale as they will not generate any stock move nor invoice line. Closes #14375 --- modules/web_shop_shopify/sale.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/web_shop_shopify/sale.py b/modules/web_shop_shopify/sale.py index 0d8fc947c6..994b27708e 100644 --- a/modules/web_shop_shopify/sale.py +++ b/modules/web_shop_shopify/sale.py @@ -211,12 +211,13 @@ class Sale(IdentifierMixin, metaclass=PoolMeta): def process(cls, sales): for sale in sales: for line in sale.lines: - if not line.product and line.shopify_identifier: - raise SaleConfirmError( - gettext('web_shop_shopify' - '.msg_sale_line_without_product', - sale=sale.rec_name, - line=line.rec_name)) + if line.shopify_identifier and line.quantity: + if not line.product: + raise SaleConfirmError( + gettext('web_shop_shopify' + '.msg_sale_line_without_product', + sale=sale.rec_name, + line=line.rec_name)) super().process(sales) for sale in sales: if not sale.web_shop or not sale.shopify_identifier: