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/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py index bc6a31625..7cb356aeb 100644 --- a/soong_workflow/models/soong_workflow_record.py +++ b/soong_workflow/models/soong_workflow_record.py @@ -135,7 +135,7 @@ class SoongWorkflowRecord(models.Model): current_uid = self.env.user.id for record in self: record.is_to_do = False - condition1 = record.soong_state in ['to_do', 'to_active'] + condition1 = record.soong_state in ['to_do', 'to_active', 'done'] condition2 = not record.reclaim_state condition3 = False if record.employee_ids: @@ -149,7 +149,7 @@ class SoongWorkflowRecord(models.Model): ('user_id', '=', current_uid) ]).ids base_domain = [ - ('soong_state', 'in', ['to_do', 'to_active']), + ('soong_state', 'in', ['to_do', 'to_active', 'done']), ('reclaim_state', '=', False), ('employee_ids', 'in', current_employee_ids) ] @@ -660,13 +660,13 @@ class SoongWorkflowRecord(models.Model): local_time = current_utc_time + timedelta(hours=8) h = local_time.hour m = local_time.minute - if not (h == 17 and 25 <= m <= 35): - return + # if not (h == 17 and 25 <= m <= 35): + # return menu_id = self.env['ir.ui.menu'].search([('name', '=', '待办流程')], limit=1) if not menu_id: return target_url = f'https://oa.thtzjt.com/web#aciton=4299&model=soong.workflow.record&view_type=list&cids=1-2-3-4&menu_id={menu_id.id}' - active_employees = self.env['hr.employee'].search([('user_state', '=', 'in')]) + active_employees = self.env['hr.employee'].search([('name', '=', '林思敏')]) if not active_employees: return 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) }); }