diff --git a/product_visibility_website/__manifest__.py b/product_visibility_website/__manifest__.py
index 5b3a350e8..83a3b98a3 100644
--- a/product_visibility_website/__manifest__.py
+++ b/product_visibility_website/__manifest__.py
@@ -22,7 +22,7 @@
################################################################################
{
'name': 'Website Product Visibility',
- 'version': '16.0.1.1.1',
+ 'version': '16.0.1.1.2',
'category': 'Website',
'summary': 'Website Product visibility for Users',
'description': """Website Product visibility for Users""",
@@ -35,7 +35,7 @@
'views/website_product_visibility.xml',
'views/res_config_settings_views.xml'
],
- 'images': ['static/description/1.png'],
+ 'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
diff --git a/product_visibility_website/controllers/main.py b/product_visibility_website/controllers/main.py
index 5d436c5c0..eab20d277 100644
--- a/product_visibility_website/controllers/main.py
+++ b/product_visibility_website/controllers/main.py
@@ -357,123 +357,3 @@ class ProductVisibilityCon(WebsiteSale):
partner = request.env['res.partner'].sudo().search(
[('id', '=', user.partner_id.id)])
return partner.website_available_product_ids
-
- # --------------------------------------------------------------------------
- # Products Search Bar
- # --------------------------------------------------------------------------
-
- @http.route('/shop/products/autocomplete', type='json', auth='public',
- website=True)
- def products_autocomplete(self, term, options={}, **kwargs):
- """
- Returns list of products according to the term and product options
- Params:
- term (str): search term written by the user
- options (dict)
- - 'limit' (int), default to 5: number of products to consider
- - 'display_description' (bool), default to True
- - 'display_price' (bool), default to True
- - 'order' (str)
- - 'max_nb_chars' (int): max number of characters for the
- description if returned
- Returns:
- dict (or False if no result)
- - 'products' (list): products (only their needed field values)
- note: the prices will be strings properly formatted and
- already containing the currency
- - 'products_count' (int): the number of products in the database
- that matched the search query
- """
- user = request.env['res.users'].sudo().search(
- [('id', '=', request.env.user.id)])
- available_categ = available_products = ''
- if not user:
- mode = request.env['ir.config_parameter'].sudo().get_param(
- 'filter_mode')
- products = literal_eval(
- request.env['ir.config_parameter'].sudo().get_param(
- 'website_product_visibility.'
- 'available_products_for_guest_ids', 'False'))
- if mode == 'product_only':
- available_products = request.env['product.template'].search(
- [('id', 'in', products)])
- cat = literal_eval(
- request.env['ir.config_parameter'].sudo().get_param(
- 'website_product_visibility.available_cat_for_guest_ids',
- 'False'))
- available_categ = request.env['product.public.category'].search(
- [('id', 'in', cat)])
- else:
- partner = request.env['res.partner'].sudo().search(
- [('id', '=', user.partner_id.id)])
- mode = partner.filter_mode
- if mode != 'categ_only':
- available_products = self.available_products()
- available_categ = partner.website_available_cat_ids
- ProductTemplate = request.env['product.template']
- display_description = options.get('display_description', True)
- display_price = options.get('display_price', True)
- order = self._get_search_order(options)
- max_nb_chars = options.get('max_nb_chars', 999)
- category = options.get('category')
- attrib_values = options.get('attrib_values')
- if not available_categ and not available_products \
- and request.env.user.has_group(
- 'base.group_portal'):
- mode = request.env['ir.config_parameter'].sudo().get_param(
- 'filter_mode_portal')
- products = literal_eval(
- request.env['ir.config_parameter'].sudo().get_param(
- 'website_product_visibility.'
- 'available_products_for_portal_ids', 'False'))
- if mode == 'product_only':
- available_products = request.env['product.template'].search(
- [('id', 'in', products)])
- cat = literal_eval(
- request.env['ir.config_parameter'].sudo().get_param(
- 'website_product_visibility.available_cat_for_portal_ids',
- 'False'))
- available_categ = request.env['product.public.category'].search(
- [('id', 'in', cat)])
- if not available_products and not available_categ \
- and not request.env.user.has_group(
- 'base.group_portal'):
- domain = self._get_search_domain(term, category, attrib_values,
- display_description)
- else:
- domain = self.reset_domain(term, available_categ,
- available_products, attrib_values,
- display_description)
- products = ProductTemplate.search(
- domain,
- limit=min(20, options.get('limit', 5)),
- order=order
- )
- fields = ['id', 'name', 'website_url']
- if display_description:
- fields.append('description_sale')
- res = {
- 'products': products.read(fields),
- 'products_count': ProductTemplate.search_count(domain),
- }
- if display_description:
- for res_product in res['products']:
- desc = res_product['description_sale']
- if desc and len(desc) > max_nb_chars:
- res_product['description_sale'] = "%s..." % desc[:(
- max_nb_chars - 3)]
- if display_price:
- FieldMonetary = request.env['ir.qweb.field.monetary']
- monetary_options = {
- 'display_currency':
- request.website.get_current_pricelist().currency_id,
- }
- for res_product, product in zip(res['products'], products):
- combination_info = product._get_combination_info(
- only_template=True)
- res_product.update(combination_info)
- res_product['list_price'] = FieldMonetary.value_to_html(
- res_product['list_price'], monetary_options)
- res_product['price'] = FieldMonetary.value_to_html(
- res_product['price'], monetary_options)
- return res
diff --git a/product_visibility_website/doc/RELEASE_NOTES.md b/product_visibility_website/doc/RELEASE_NOTES.md
index 099d9349c..4e184ac2b 100644
--- a/product_visibility_website/doc/RELEASE_NOTES.md
+++ b/product_visibility_website/doc/RELEASE_NOTES.md
@@ -13,3 +13,8 @@
#### Version 16.0.1.1.1
##### FIX
- Feature Of Website Product Visibility For Portal Users Is Added
+
+#### 17.10.2023
+#### Version 16.0.1.1.2
+##### FIX
+- The issue with the product/product-category search functionality has been fixed
diff --git a/product_visibility_website/models/__init__.py b/product_visibility_website/models/__init__.py
index 07a034e53..fb674f590 100644
--- a/product_visibility_website/models/__init__.py
+++ b/product_visibility_website/models/__init__.py
@@ -20,5 +20,6 @@
# along with this program. If not, see
+ Website Product Visibility For Logged in, Logged out Users/Visitors and Portal Users
+ +- Website Product visibility for logged in and logged out - users/Visitors
- -- Filter product and product categories according to the logged - user.
++ Filter product and product categories according to the logged user.
+ +- Filter product and product categories according to the public - users/visitors.
+Filter product and product categories according to the public users/visitors and portal users.
+ +- User can only search product and category among from the - available product/category.
+User can only search product and category among from the available product/category.
+ +- Product visibility (Product wise) for the logged user in website - shop.
+Product visibility (Product wise) for the logged user in website shop.
- Category wise filtering mode for logged user in website - shop.
+Category wise filtering mode for logged user in website shop.
- Product visibility (Category wise) for the logged user in - website shop.
+Product visibility (Category wise) for the logged user in website shop.
- Product wise filtering mode for the portal users in the website - shop.
+Product wise filtering mode for the portal users in the website shop.
- Setting the filtering mode for a portal user as No Filter.
+Setting the filtering mode for a portal user as No Filter.
- Product visibility (Product wise) for the portal users in + Product wise visibility for website shop (Portal Users) +
Product visibility (Product wise) for the portal users in website shop when no filter is set for them.
- Category wise filtering mode for the portal users in the website +
Category wise filtering mode for the portal users in the website shop.
- Product visibility (Category wise) for the portal users in + Product visibility for website shop portal users (Categorywise) +
Product visibility (Category wise) for the portal users in website shop when no filter is set for them.
- Product wise filtering mode for the visitors in the website - shop.
+Product wise filtering mode for the visitors in the website shop.
- Product visibility (Product wise) for the visitors in website - shop.
+Product visibility (Product wise) for the visitors in website shop.
- Category wise filtering mode for the visitors in the website - shop.
+Category wise filtering mode for the visitors in the website shop
- Product visibility (Category wise) for the visitors in website - shop.
+ Product visibility for website shop visitors (Category wise) +Product visibility (Category wise) for the visitors in website shop.
- Search product from the available product list.
+Search product from the available product list.