[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
This commit is contained in:
Nicolas Martinelli
2017-05-19 10:38:52 +02:00
parent 965d0c50ec
commit 53b5c48bc6
+1 -1
View File
@@ -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,