diff --git a/website_search_products/controllers/controller.py b/website_search_products/controllers/controller.py index 3df776c..65db252 100644 --- a/website_search_products/controllers/controller.py +++ b/website_search_products/controllers/controller.py @@ -4,6 +4,7 @@ from odoo import http from odoo.http import request from odoo.addons.website.controllers.main import Website +from werkzeug.utils import redirect import logging @@ -22,7 +23,7 @@ class InventoryForm(http.Controller): has_internal = user.has_group("base.group_user") if not has_portal and not has_internal: - return http.redirect("/web") + return redirect("/web") # Fetch active products available in POS products = ( @@ -49,11 +50,11 @@ class WebsiteController(Website): # Redirect internal users to web, others to inventory search if user.has_group("base.group_user"): # Keep original redirect for internal users - redirect = "/web" + redirect_url = "/web" else: # Redirect portal users to inventory search - redirect = "/inventory/search" + redirect_url = "/inventory/search" - return http.redirect(redirect) + return redirect(redirect_url) return response diff --git a/website_search_products/views/web_templates.xml b/website_search_products/views/web_templates.xml index 6480702..3525351 100644 --- a/website_search_products/views/web_templates.xml +++ b/website_search_products/views/web_templates.xml @@ -37,21 +37,21 @@ - + - + - - - +