From 0d7fe2d02e072066154f6219efbd4df00d1e2e26 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 (grafted from bbd807ca4b87dc0470bd5f3db69681e7371c6d13) --HG-- branch : 7.0 --- 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 4a4a16673a..404ef2e48c 100644 --- a/modules/web_shop_shopify/sale.py +++ b/modules/web_shop_shopify/sale.py @@ -201,12 +201,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: