mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
int app-odoo 17, paid
This commit is contained in:
16
app_odoo_customize/static/src/webclient/user_menu.xml
Normal file
16
app_odoo_customize/static/src/webclient/user_menu.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="app_odoo_customize.UserMenu" t-inherit="web.UserMenu" t-inherit-mode="extension">
|
||||
<xpath expr="//t[@t-key='element_index']" position="before">
|
||||
<t t-if="app_show_lang">
|
||||
<t t-foreach="app_lang_list" t-as="lang" t-key="lang.id">
|
||||
<DropdownItem dataset="{ lang: lang.id, code: lang.code }" onSelected="() => this.setLang(lang.code)">
|
||||
<img class="flag" t-att-src="'/app_odoo_customize/static/src/img/flags/' + lang['code'] + '.png'"/>
|
||||
<t t-out="lang.name"/>
|
||||
<i class="fa fa-check" t-if="user.lang == lang.code"></i>
|
||||
</DropdownItem>
|
||||
</t>
|
||||
</t>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
27
app_odoo_customize/static/src/webclient/webclient.js
Normal file
27
app_odoo_customize/static/src/webclient/webclient.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { WebClient } from "@web/webclient/webclient";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { session } from "@web/session";
|
||||
|
||||
patch(WebClient.prototype, "app_odoo_customize.WebClient", {
|
||||
setup() {
|
||||
// 处理 navbar 全局可配置位置
|
||||
var self = this;
|
||||
self._super.apply(this, arguments);
|
||||
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 || 'odooAi';
|
||||
// zopenerp is easy to grep
|
||||
this.title.setParts({ zopenerp: app_system_name });
|
||||
|
||||
}
|
||||
});
|
||||
21
app_odoo_customize/static/src/webclient/webclient.xml
Normal file
21
app_odoo_customize/static/src/webclient/webclient.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<!-- 移动端nav在下方,可配置处理-->
|
||||
<!-- 调整为 css flex处理,不改xml-->
|
||||
<!-- <t t-name="app_web_enterprise.WebClient" t-inherit="web.WebClient" t-inherit-mode="extension">-->
|
||||
<!-- <xpath expr="//t/t" position="attributes">-->
|
||||
<!-- <attribute name="t-if">-->
|
||||
<!-- !state.fullscreen and state.navbar_pos!='bottom'-->
|
||||
<!-- </attribute>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//MainComponentsContainer" position="after">-->
|
||||
<!-- <t t-if="!state.fullscreen and state.navbar_pos=='bottom'">-->
|
||||
<!-- <NavBar/>-->
|
||||
<!-- </t>-->
|
||||
<!-- <div class="row" style="height:200px">-->
|
||||
<!-- 增加Debug pad-->
|
||||
<!-- </div>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </t>-->
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user