From 68293dbccaaa3b1724209fb3bfd43f7319d9aff9 Mon Sep 17 00:00:00 2001 From: JasminSForgeFlow Date: Mon, 18 Mar 2024 12:17:08 +0530 Subject: [PATCH] [IMP] queue_job_batch: Fix systray icon visibility for allowed group users only --- .../static/src/js/systray_service.esm.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/queue_job_batch/static/src/js/systray_service.esm.js b/queue_job_batch/static/src/js/systray_service.esm.js index f70979369c..c786e765a0 100644 --- a/queue_job_batch/static/src/js/systray_service.esm.js +++ b/queue_job_batch/static/src/js/systray_service.esm.js @@ -1,18 +1,24 @@ /** @odoo-module **/ import {QueueJobBatchMenuContainer} from "./batch_menu_container_view.esm"; - import {registry} from "@web/core/registry"; +import session from "web.session"; const systrayRegistry = registry.category("systray"); export const systrayService = { start() { - systrayRegistry.add( - "queue_job_batch.QueueJobBatchMenu", - {Component: QueueJobBatchMenuContainer}, - {sequence: 99} - ); + session + .user_has_group("queue_job_batch.group_queue_job_batch_user") + .then(function (has_group) { + if (has_group) { + systrayRegistry.add( + "queue_job_batch.QueueJobBatchMenu", + {Component: QueueJobBatchMenuContainer}, + {sequence: 99} + ); + } + }); }, };