[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user