Browse Source

[FIX] website_sale_advanced_search: Add domain search if website published

When you run a search, the result returns products that are not published on the website.
pull/103/head
Unknown 7 years ago
committed by zuher83
parent
commit
fd3a1f463e
  1. 1
      website_sale_advanced_search/controllers/main.py

1
website_sale_advanced_search/controllers/main.py

@ -18,6 +18,7 @@ class WebsiteSearch(http.Controller):
category = int(kw.get('category')) if not kw.get('category') == 'all' else ''
try:
domain = [('public_categ_ids', 'child_of', [category])] if category else []
domain.append(('website_published','=', True))
product_as_category = request.env['product.template'].search(domain)
sql = """select id as res_id, name as name, name as value from product_template where name ILIKE %s"""
extra_query = ''

Loading…
Cancel
Save