From 0687a5e67d73b3df2e41ff4dea80320805324036 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 9 Apr 2015 15:43:29 +0200 Subject: [PATCH] [FIX] website_sale_options: Total in shopping cart The unit price of each option of a product must be recompute when the quantity of the product changes. --- addons/website_sale_options/models/sale_order.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/website_sale_options/models/sale_order.py b/addons/website_sale_options/models/sale_order.py index 85eaab214f7..695f8585201 100644 --- a/addons/website_sale_options/models/sale_order.py +++ b/addons/website_sale_options/models/sale_order.py @@ -48,13 +48,11 @@ class sale_order(osv.Model): }) # select linked product - option_ids = [l.id for l in so.order_line if l.linked_line_id.id == line.id] + option_ids = [l for l in so.order_line if l.linked_line_id.id == line.id] - if option_ids: - # update line - sol.write(cr, SUPERUSER_ID, option_ids, { - 'product_uom_qty': value.get('quantity') - }, context=context) + # update line + for l in option_ids: + super(sale_order, self)._cart_update(cr, uid, ids, l.product_id.id, l.id, add_qty, set_qty, context=context, **kwargs) - value['option_ids'] = option_ids + value['option_ids'] = [l.id for l in option_ids] return value