Files
gzth/app_odoo_customize/static/src/webclient/webclient.js
T
2025-01-20 10:03:24 +08:00

28 lines
927 B
JavaScript

/** @odoo-module **/
import { WebClient } from "@web/webclient/webclient";
import { patch } from "@web/core/utils/patch";
import { session } from "@web/session";
patch(WebClient.prototype, {
setup() {
// 处理 navbar 全局可配置位置
var self = this;
super.setup();
this.state.navbar_pos_pc = session.app_navbar_pos_pc || 'top';
this.state.navbar_pos_mobile = session.app_navbar_pos_mobile || 'top';
if (self.env.isSmall)
this.state.navbar_pos = this.state.navbar_pos_mobile;
else
this.state.navbar_pos = this.state.navbar_pos_pc;
if (this.state.navbar_pos === 'bottom') {
document.body.className += ' navbar_pos_bottom';
}
const app_system_name = session.app_system_name || '天投集团';
// zopenerp is easy to grep
this.title.setParts({ zopenerp: app_system_name });
}
});