From c61a475543faffedc53ddc4dc334f5e8f77d4def Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Mon, 9 Mar 2026 19:04:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/js/navbar.js | 7 +++++++ .../static/src/webclient/actions/client_actions.js | 9 ++++++++- sun_badge_menu/static/src/webclient/navbar/navbar.js | 11 ++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) 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) }); } From a259fa1aa30e5b267d6ec146f01ce1bafbc4a425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Mon, 9 Mar 2026 19:09:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soong_workflow/models/soong_workflow_record.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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