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
This commit is contained in:
1 parent
b54654ed4c
commit
0d7fe2d02e
1 file changed
+7
-6
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user