[FIX] website_sale: do not replace context

Add quantity key to context instead of overwrite the entire context
If another context key was present, it would be lost

Introduced at 166a9d26e3

closes odoo/odoo#30519
This commit is contained in:
Katherine Zaoral
2019-01-24 14:42:52 +00:00
committed by Martin Trigaux
parent 8f47b028ed
commit 43b7dfed67
+1 -1
View File
@@ -983,7 +983,7 @@ class WebsiteSale(http.Controller):
@http.route(['/shop/get_unit_price'], type='json', auth="public", methods=['POST'], website=True)
def get_unit_price(self, product_ids, add_qty, **kw):
products = request.env['product.product'].with_context({'quantity': add_qty}).browse(product_ids)
products = request.env['product.product'].with_context(quantity=add_qty).browse(product_ids)
return {product.id: product.website_price / add_qty for product in products}
# ------------------------------------------------------