合并企业版代码(未测试,先提交到测试分支)
This commit is contained in:
26
web_mobile/static/src/js/mobile_service.js
Normal file
26
web_mobile/static/src/js/mobile_service.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
import mobile from "web_mobile.core";
|
||||
import { shortcutItem, switchAccountItem } from "./user_menu_items";
|
||||
|
||||
const serviceRegistry = registry.category("services");
|
||||
const userMenuRegistry = registry.category("user_menuitems");
|
||||
|
||||
const mobileService = {
|
||||
start() {
|
||||
if (mobile.methods.addHomeShortcut) {
|
||||
userMenuRegistry.add("web_mobile.shortcut", shortcutItem);
|
||||
}
|
||||
|
||||
if (mobile.methods.switchAccount) {
|
||||
// remove "Log Out" and "My Odoo.com Account"
|
||||
userMenuRegistry.remove('log_out');
|
||||
userMenuRegistry.remove('odoo_account');
|
||||
|
||||
userMenuRegistry.add("web_mobile.switch", switchAccountItem);
|
||||
}
|
||||
},
|
||||
};
|
||||
serviceRegistry.add("mobile", mobileService);
|
||||
Reference in New Issue
Block a user