xml - Odoo13 - 从右上角替换 UserMenu
问题描述
我正在使用 Odoo13 CE,我想删除像文档和我的 odoo.com 这样的用户菜单。
我尝试通过继承 UserMenu 模板:
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<templates id="template" xml:space="preserve">
<t t-extend="UserMenu">
<t t-jquery="div.dropdown-menu.dropdown-menu-right" t-operation="replace">
<div class="dropdown-menu dropdown-menu-right" role="menu">
<a role="menuitem" href="#" data-menu="shortcuts" class="dropdown-item d-none d-md-inline-block">Shortcuts</a>
<a role="menuitem" href="#" data-menu="settings" class="dropdown-item">Preferences</a>
<a role="menuitem" href="#" data-menu="logout" class="dropdown-item">Log out</a>
</div>
</t>
</t>
</templates>
</odoo>
我的模块结构:
{
'name': 'Replace UserMenu.Action',
'description': """
Remove some UserMenu""",
'version': '13',
'license': 'AGPL-3',
'author': 'Rafael',
'website': ' ',
'depends': [
'base', 'web'
],
'data': [
],
'demo': [
],
'qweb': [
'static/src/xml/change_menu2.xml'
],
}
但到目前为止还没有运气。我也尝试过使用或不使用odoo标签,将模板更改为模板,但它无论如何都不起作用。我尝试重新安装模块,使用 -u、-i 和 -d 等命令,但没有成功。
我也试过这个>>> \ https://www.odoo.com/forum/help-1/question/remove-support-menu-entry-from-top-right-corner-150211
我需要添加一些JS代码或类似的东西吗?
提前致谢。
解决方案
尝试以这种方式扩展模板,
<?xml version="1.0" encoding="utf-8"?>
<template xml:space="preserve">
<t t-extend="UserMenu.Actions">
<t t-jquery="a[data-menu='documentation']" t-operation='replace'></t>
</t>
</template>
谢谢
推荐阅读
- windows - Windows 10 讲述人。键盘快捷键。从当前光标处读取文档
- javascript - Highcharts - 不显示数据
- makefile - Makefile 不处理所有命令
- c - 如何将二维数组作为双指针传递给c中的函数?
- awk - awk 忽略特定列中引号内的字段分隔符,然后将其移动
- eclipse - 在 Eclipse 中添加 mysql-java 依赖项时出现 maven 问题
- android - Mockito doReturn 无法按预期工作
- c# - 尝试在 iMobileDevice 中查找设备的 STORAGE SIZE 时,lockdownd_get_value() 的 KEY 是什么?
- python - 以特定格式将元组转储到 YAML 文件中
- android - 调用 notifyDataSetChanged() 时 RecyclerView 跳转到顶部