Skip to content
Snippets Groups Projects
Commit 53b5c48b authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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
parent 965d0c50
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment