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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user