[FIX] website_sale, website_sale_product_configurator: fix cart update
Commitsdf2ea31ff6and55ed70f405moved things around, "without any functional change". They made it so that if you add twice a product to the cart, they are added in different lines instead of merged. There are two issues: - the `if line_id: return lines` made sense when the post-filtering was in the same function, since it could readily be avoided - conversely the post-filtering was avoided in the function that was added with the only goal to do it, except in the case where it was useless (the case where lines is an empty recordset). opw 2083729 closes odoo/odoo#38938 X-original-commit: c9c0a0c322f02974bc6395410ca3d7213899c7e0 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
@@ -89,12 +89,7 @@ class SaleOrder(models.Model):
|
||||
else:
|
||||
domain += [('product_custom_attribute_value_ids', '=', False)]
|
||||
|
||||
lines = self.env['sale.order.line'].sudo().search(domain)
|
||||
|
||||
if line_id:
|
||||
return lines
|
||||
|
||||
return self.env['sale.order.line']
|
||||
return self.env['sale.order.line'].sudo().search(domain)
|
||||
|
||||
def _website_product_id_change(self, order_id, product_id, qty=0):
|
||||
order = self.sudo().browse(order_id)
|
||||
|
||||
@@ -9,7 +9,7 @@ class SaleOrder(models.Model):
|
||||
|
||||
def _cart_find_product_line(self, product_id=None, line_id=None, **kwargs):
|
||||
lines = super(SaleOrder, self)._cart_find_product_line(product_id, line_id, **kwargs)
|
||||
if lines:
|
||||
if line_id: # in this case we get the exact line we want, so filtering below would be wrong
|
||||
return lines
|
||||
|
||||
linked_line_id = kwargs.get('linked_line_id', False)
|
||||
|
||||
Reference in New Issue
Block a user