[IMP]hide_portal_module_by_user: fix invoices access in v18

This commit is contained in:
2026-08-10 16:04:48 +02:00
parent 76d0085c2d
commit bb759eb8ca
4 changed files with 67 additions and 9 deletions

View File

@@ -2,9 +2,17 @@
<odoo>
<data>
<template inherit_id="portal.portal_docs_entry" id="hide_portal_user">
<xpath expr="//a" position="attributes">
<attribute name="t-if">request.env.user.validate_portal_url(url)</attribute>
</xpath>
<!-- Since 18.0 the entry link is wrapped in a "o_portal_index_card"
div, which the portal javascript un-hides once the counters are
loaded. The t-if has to be carried by that card, otherwise
hiding the link only leaves an empty card in the grid.
The card class is dynamic (t-att-class), so hasclass() cannot
be used to locate it. -->
<xpath expr="//a/.." position="attributes">
<!-- config_card entries (Connection &amp; Security) are not
document listings and are never group restricted. -->
<attribute name="t-if">config_card or request.env.user.validate_portal_url(url)</attribute>
</xpath>
</template>
</data>
</odoo>