[FIX] website_sale: Search domain for shop must manage

- company
 - published state

Search a product on shop, Filter on shop
must compute data and take care of company and published state

opw-3251404

closes odoo/odoo#119352

X-original-commit: 4ea5ca541a12435c48a4f9f41f2cee3cf21532c4
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Gaetan Vanden Bergh (gavb)
2023-04-22 05:52:21 +02:00
parent 56ddfdaa6a
commit 4ba88044ee
+3 -1
View File
@@ -386,7 +386,9 @@ class WebsiteSale(http.Controller):
domain = self._get_search_domain(search, category, attrib_values)
# This is ~4 times more efficient than a search for the cheapest and most expensive products
from_clause, where_clause, where_params = Product._where_calc(domain).get_sql()
query = Product._where_calc(domain)
Product._apply_ir_rules(query, 'read')
from_clause, where_clause, where_params = query.get_sql()
query = f"""
SELECT COALESCE(MIN(list_price), 0) * {conversion_rate}, COALESCE(MAX(list_price), 0) * {conversion_rate}
FROM {from_clause}