mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix mobile
This commit is contained in:
@@ -94,7 +94,7 @@ patch(UserMenu.prototype, {
|
|||||||
browser.clearTimeout(self.toggleTimer);
|
browser.clearTimeout(self.toggleTimer);
|
||||||
if (self.user_lang !== lang_code) {
|
if (self.user_lang !== lang_code) {
|
||||||
const res = await self.orm.call("res.users", "write", [
|
const res = await self.orm.call("res.users", "write", [
|
||||||
session.uid, {'lang': lang_code}
|
session.user_id[0], {'lang': lang_code}
|
||||||
]);
|
]);
|
||||||
location.reload();
|
location.reload();
|
||||||
// 调用 action , 要先定义 self.action = useService("action")
|
// 调用 action , 要先定义 self.action = useService("action")
|
||||||
|
|||||||
@@ -14,4 +14,19 @@
|
|||||||
</t>
|
</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
|
<!-- 移动端独立-->
|
||||||
|
<t t-name="app_odoo_customize.UserMenu" t-inherit="web.BurgerUserMenu" 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 attrs="{ 'data-lang': lang.id, 'data-code': lang.code }" class="'py-3 fs-4'"
|
||||||
|
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>
|
</templates>
|
||||||
|
|||||||
Reference in New Issue
Block a user