我正在使用Odoo13 CE,并且希望删除用户菜单,如Documentation和My 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](https://www.odoo.com/forum/help-1/question/remove-support-menu-entry-from-top-right-corner-150211)
我需要添加一些JS代码或类似的东西吗?
提前谢谢。
发布于 2020-03-17 13:33:46
尝试以这种方式扩展模板,
<?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>谢谢
https://stackoverflow.com/questions/60707346
复制相似问题