From 53b5c48bc620561fd78bcd8e6c8d740daed91906 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 19 May 2017 10:36:38 +0200 Subject: [PATCH] [FIX] website_sale: potential crash `_cart_find_product_line` can return more than 1 order line . Since it might be necessary in `website_sale_options`, just prevent the crash. opw-743805 --- addons/website_sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index b95b1afcffd..94edada65ac 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -71,7 +71,7 @@ class SaleOrder(models.Model): if order.pricelist_id and order.partner_id: order_line = order._cart_find_product_line(product.id) if order_line: - pu = self.env['account.tax']._fix_tax_included_price(pu, product.taxes_id, order_line.tax_id) + pu = self.env['account.tax']._fix_tax_included_price(pu, product.taxes_id, order_line[0].tax_id) return { 'product_id': product_id,