[FIX] website_sale: fix offcanvas bubble

The bubble is showed whenever a filter is activated and/or a price range
is selected in the filters.
However due to float precision the comparison made to check whether
there is a price filter could be wrong when using "weird" numbers.

TaskId-3009210

closes odoo/odoo#102507

X-original-commit: 9359a5b5f0f72550d69671f975da23d4734b490f
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit is contained in:
William Braeckman
2022-10-06 22:22:39 +02:00
parent b42c621438
commit 09c53d8eee
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -466,6 +466,7 @@ class WebsiteSale(http.Controller):
'layout_mode': layout_mode,
'products_prices': products_prices,
'get_product_prices': lambda product: lazy(lambda: products_prices[product.id]),
'float_round': tools.float_round,
}
if filter_by_price_enabled:
values['min_price'] = min_price or available_min_price
+1 -1
View File
@@ -283,7 +283,7 @@
<t t-set="hasLeftColumn" t-value="opt_wsale_categories or opt_wsale_attributes"/>
<t t-set="isFilteringByPrice" t-if="opt_wsale_filter_price" t-value="available_min_price != min_price or available_max_price != max_price"/>
<t t-set="isFilteringByPrice" t-if="opt_wsale_filter_price" t-value="float_round(available_min_price, 2) != float_round(min_price, 2) or float_round(available_max_price, 2) != float_round(max_price, 2)"/>
<t t-set="hasPricelistDropdown" t-value="website_sale_pricelists and len(website_sale_pricelists)&gt;1"/>
<t t-set="isSortingBy" t-value="[sort for sort in website_sale_sortable if sort[0]==request.params.get('order', '')]"/>