跳至內容
選單
此問題已被標幟

I try for example to remove the "My Account" link from the main navigation.

After looking through code I found the template responsible for adding the link in addons/portal/views/portal_templates.xml:

<template id="my_account_link" name="Link to frontend portal" inherit_id="portal.frontend_layout">
<xpath expr="//a[@id='o_logout']" position="before">
<a href="/my/home" role="menuitem" class="dropdown-item">My Account</a>
</xpath>
</template>

I thought that I could simply override the inherited template by doing

<template id="portal.my_account_link">
</template>

which throws an error: "Element '<t t-name="portal.my_account_link">' cannot be found in parent view."


My question is:

How can I undo changes made by an inherited template of an existing addon?

Please note that I'm not asking for a different way to hide the my account link. I'd like to know, how you experienced odoo developers modify changes different addons want to apply.

Thanks a lot,
Martin


頭像
捨棄
最佳答案

Hello

You have to delete the record directly. E.g:

In the file: your_module_name/data/ir_ui_view_data.xml

< delete model="ir.ui.view" id="purchase_discount.report_purchaseorder_document"/>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 22
7025
2
3月 15
7607
1
12月 23
1737
5
9月 19
5859
2
12月 22
22988