diff --git a/sh_backmate_theme_adv_enterprise/static/src/js/navbar.js b/sh_backmate_theme_adv_enterprise/static/src/js/navbar.js index c24823a1b..9c177f0dd 100644 --- a/sh_backmate_theme_adv_enterprise/static/src/js/navbar.js +++ b/sh_backmate_theme_adv_enterprise/static/src/js/navbar.js @@ -17,6 +17,8 @@ var sidebar_collapse_style = ''; var search_style = ''; var enable_multi_tab = false +const HIDDEN_ITEMS = ['mail.messaging_menu', 'mail.activity_menu'] + patch(NavBar.prototype, { //-------------------------------------------------------------------------- @@ -82,6 +84,11 @@ patch(NavBar.prototype, { } } }, + + get systrayItems() { + const res = super.systrayItems; + return res.filter((item) => !HIDDEN_ITEMS.includes(item.key)) + }, /** * 切换全屏显示 **/ diff --git a/sun_badge_menu/static/src/webclient/actions/client_actions.js b/sun_badge_menu/static/src/webclient/actions/client_actions.js index fceb68936..535100536 100644 --- a/sun_badge_menu/static/src/webclient/actions/client_actions.js +++ b/sun_badge_menu/static/src/webclient/actions/client_actions.js @@ -9,6 +9,9 @@ import {escape, sprintf} from "@web/core/utils/strings"; import {Component, markup, onMounted, xml} from "@odoo/owl"; +export function clickRefreshButton() { + document.querySelector('button[name="sh_refresh"].sh_refresh')?.click(); +} /** * Client action to go back home. */ @@ -54,7 +57,11 @@ async function flushBadgeWithWorkflow(env, action) { // 跳转tree or kanban const { tree_id, kanban_id, uid } = action.params; if (tree_id && kanban_id && uid) { - return env.services.action.doAction(getWkfAction(tree_id, kanban_id, uid, env.isSmall)); + env.services.action.doAction(getWkfAction(tree_id, kanban_id, uid, env.isSmall)); + setTimeout(() => { + clickRefreshButton(); + }, 300) + return } const controller = env.services.action.currentController; diff --git a/sun_badge_menu/static/src/webclient/navbar/navbar.js b/sun_badge_menu/static/src/webclient/navbar/navbar.js index 4e6b5be46..e9feaa542 100644 --- a/sun_badge_menu/static/src/webclient/navbar/navbar.js +++ b/sun_badge_menu/static/src/webclient/navbar/navbar.js @@ -5,6 +5,7 @@ import { patch } from "@web/core/utils/patch"; import { deepCopy } from "@web/core/utils/objects"; import { useService } from "@web/core/utils/hooks"; import { url } from "@web/core/utils/urls"; +import { clickRefreshButton } from "../actions/client_actions" const WKF_NOTIFY_TYPE = 'wkf_notify' @@ -27,9 +28,12 @@ patch(NavBar.prototype, { for (const d of detail) { if (d?.type === WKF_NOTIFY_TYPE) { this.menuService.reload(); - return this.audio.play().catch((e) => { - console.log(e) - }); + return this.audio.play() + .then(() => { + clickRefreshButton(); + }).catch((e) => { + console.log(e) + }); } } @@ -59,6 +63,7 @@ patch(NavBar.prototype, { } } } + clickRefreshButton(); }, 300) }); }