Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
11557 Vizualizări

Hi everyone,

I want to hide only invoice section from the "Your Document" from the <odooURL:port>/my/home page in odoo 12, but I am not sure how can I achieve that using custom module.


I tried to lookup at the odoo source code and here is how the template defined.

My home main template:

    <template id="portal_my_home" name="My Portal">
        <t t-call="portal.portal_layout">
<t t-set="my_details" t-value="True"/>
<div class="o_portal_my_home">
<div class="oe_structure" id="oe_structure_portal_my_home_1"/>
<h3>Your Documents</h3>
<div class="o_portal_docs list-group">
</div>
</div>
<div class="oe_structure" id="oe_structure_portal_my_home_2"/>
</t>
</template>

and the templete to add the document:

    <template id="portal_docs_entry" name="My Portal Docs Entry">
        <a t-att-href="url" t-att-title="title" class="list-group-item list-group-item-action d-flex align-items-center justify-content-between">
<t t-esc="title"/>
<span class="badge badge-secondary badge-pill" t-esc="count"/>
</a>
</template>

And this will substitute the value to the template for invoice,

    <template id="portal_my_home_invoice" name="Portal My Home : invoice entries" inherit_id="portal.portal_my_home" priority="30">
        <xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
            <t t-if="invoice_count" t-call="portal.portal_docs_entry">
                <t t-set="title">Invoices</t>
                <t t-set="url" t-value="'/my/invoices'"/>
                <t t-set="count" t-value="invoice_count"/>
            </t>
        </xpath>
    </template>

I used to do this by using xpath by selecting element in odoo 10 but I am not sure how to do this in odoo 12.

Imagine profil
Abandonează
Cel mai bun răspuns

in Odoo 16 :

1) Setting>>Technical>>UserInterface>>Views

2) filter "inerithed view" column to "my portal"

3) filter "view type" column  to "Qweb"

Imagine profil
Abandonează
Cel mai bun răspuns

Activate Developer mode (with asset) and then go to  Setting>>Technical>>UserInterface>>Views

Search for "Portal My Home : invoice entries"
The update below line in architecture

<t t-if="invoice_count" t-call="portal.portal_docs_entry"">

to 

<t t-if="invoice_count" t-call="portal.portal_docs_entry" groups="base.group_user">

Your portal visitor will not see invoices

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
dec. 18
4433
5
nov. 18
8085
1
aug. 21
6121
0
feb. 21
2704
1
sept. 20
5756