diff --git a/addons/dine360_dashboard/controllers/__pycache__/main.cpython-310.pyc b/addons/dine360_dashboard/controllers/__pycache__/main.cpython-310.pyc index 9b6a727..26b8ec4 100644 Binary files a/addons/dine360_dashboard/controllers/__pycache__/main.cpython-310.pyc and b/addons/dine360_dashboard/controllers/__pycache__/main.cpython-310.pyc differ diff --git a/addons/dine360_dashboard/controllers/main.py b/addons/dine360_dashboard/controllers/main.py index 3190d80..09a55fc 100644 --- a/addons/dine360_dashboard/controllers/main.py +++ b/addons/dine360_dashboard/controllers/main.py @@ -18,16 +18,40 @@ class ImageHome(Website): if not request.session.uid: return request.render('website.homepage') - # Override root to show Dashboard for logged in users - menus = request.env['ir.ui.menu'].sudo().search([ + # Remove sudo() to respect Odoo's standard menu group restrictions + menus = request.env['ir.ui.menu'].search([ ('parent_id', '=', False) ], order='sequence') + # User role checks + is_admin = request.env.user.has_group('base.group_system') or request.env.user.has_group('dine360_restaurant.group_restaurant_admin') + is_kitchen = request.env.user.has_group('dine360_restaurant.group_restaurant_kitchen') + + filtered_menus = [] + seen_names = set() + for menu in menus: + # 1. Hide "Apps" for non-admins (usually name is 'Apps' or xmlid has base.menu_management) + if (menu.name == 'Apps' or (menu.web_icon and menu.web_icon.startswith('base,'))) and not is_admin: + continue + + # 2. Hide "Kitchen (KDS)" for Waiters (only show for Kitchen Staff or Admin) + if 'Kitchen' in menu.name or 'KDS' in menu.name: + if not (is_kitchen or is_admin): + continue + + # 3. De-duplicate by name to prevent double icons (like Kitchen showing twice) + if menu.name in seen_names: + continue + seen_names.add(menu.name) + + filtered_menus.append(menu) + return request.render('dine360_dashboard.image_home_template', { - 'menus': menus, + 'menus': filtered_menus, 'user_id': request.env.user }) + @http.route('/home', type='http', auth="public", website=True, sitemap=True) def website_home(self, **kw): # Explicit route for standard Website Homepage diff --git a/addons/dine360_dashboard/static/src/css/website_style.css b/addons/dine360_dashboard/static/src/css/website_style.css index c1def45..4f8dd6e 100644 --- a/addons/dine360_dashboard/static/src/css/website_style.css +++ b/addons/dine360_dashboard/static/src/css/website_style.css @@ -6,8 +6,8 @@ body .o_header_standard, body header.o_header_standard, body .navbar, body #o_main_nav { - background-color: #171422 !important; - background: #171422 !important; + background-color: #111 !important; + /* background: #171422 !important; */ border-bottom: none; } diff --git a/addons/dine360_dashboard/views/home_template.xml b/addons/dine360_dashboard/views/home_template.xml index 0b20dee..9596672 100644 --- a/addons/dine360_dashboard/views/home_template.xml +++ b/addons/dine360_dashboard/views/home_template.xml @@ -32,12 +32,17 @@ - - - + + + + + + +
+
diff --git a/addons/dine360_dashboard/views/web_title_template.xml b/addons/dine360_dashboard/views/web_title_template.xml index a7e157c..29f6a66 100644 --- a/addons/dine360_dashboard/views/web_title_template.xml +++ b/addons/dine360_dashboard/views/web_title_template.xml @@ -4,15 +4,17 @@ Chennora - - - Back to Dashboard - + + + + Back to Dashboard + + diff --git a/addons/dine360_restaurant/views/restaurant_menus.xml b/addons/dine360_restaurant/views/restaurant_menus.xml index 1259821..db84ff2 100644 --- a/addons/dine360_restaurant/views/restaurant_menus.xml +++ b/addons/dine360_restaurant/views/restaurant_menus.xml @@ -8,7 +8,7 @@ - +