@@ -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))
|
||||
},
|
||||
/**
|
||||
* 切换全屏显示
|
||||
**/
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user