Ajuda

1

How to remove template changes made by other addons?

Avatar
Martin Wittmann

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


Avatar
Descartar
1Resposta
0
Avatar
Mallory MARCOT
Melhor Resposta

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"/>

Avatar
Descartar