[FIX] website_sale: website price is not necessarily an INT

before this commit, when retrieving the price for a variant for the shop, a floor division was operated, giving out the wrong result.
Now, a standard division is operated
This commit is contained in:
Lucas Perais (lpe)
2017-09-21 09:26:39 +02:00
parent bbe5bd291b
commit 46d87b9d4e
+1 -1
View File
@@ -947,7 +947,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)
return {product.id: product.website_price // add_qty for product in products}
return {product.id: product.website_price / add_qty for product in products}
# ------------------------------------------------------
# Edit