From 3df2d227cf2db551cdab77a30d1176fbb6d5cbd0 Mon Sep 17 00:00:00 2001 From: Maitri Patel Date: Wed, 10 May 2023 08:52:13 +0000 Subject: [PATCH] [FIX] point_of_sale: prevent traceback while open session with the portal user when the user allows multi employee per session and the portal user tries to access the pos with the URL /pos/ui?config_id=1 then the error will be generated. steps to reproduce: - Installed point_of_sale module. - In Configuration > Point of Sale > activate Multi Employees per Session option and save it. - In another window, do log in as a demo user and start the pos session. - From the Admin user, make Marc Demo as a portal user. - Then refresh the demo user session. - Traceback will be generated Applying these changes will resolve this issue. sentry - 3958755602 closes odoo/odoo#124662 X-original-commit: 49447781b95f18a87491e47c19e4e8a6167ccf1d Signed-off-by: Robin Heinz (rhe) --- addons/point_of_sale/controllers/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/controllers/main.py b/addons/point_of_sale/controllers/main.py index 2bba0a1c693..3e7fd30c2b4 100644 --- a/addons/point_of_sale/controllers/main.py +++ b/addons/point_of_sale/controllers/main.py @@ -28,6 +28,9 @@ class PosController(PortalAccount): :type config_id: str. :returns: object -- The rendered pos session. """ + is_internal_user = request.env.user.has_group('base.group_user') + if not is_internal_user: + return request.not_found() domain = [ ('state', 'in', ['opening_control', 'opened']), ('user_id', '=', request.session.uid),