Pointer
Pointer

Reputation: 2186

Hide element in inherit qweb odoo 9

Is it possible with xpath exp in inherit qweb hide below line?

<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />

Upvotes: 0

Views: 676

Answers (1)

Phillip Stack
Phillip Stack

Reputation: 3378

You have to use replace and you have to identify the correct node. So identify the node and replace it.

<xpath expr="//t[last()]" position="replace">
    <!-- <t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" /> -->
</xpath>

I usually like to replace it with a commented out version of itself. Also the above will only work if the t tag is the last in the document.

You may have to capture a parent node and inject all of the existing xml with your desired t element commented out or removed. You may also be able to use these expressions or some variation of them.

expr="//div[@name='div_name']/t"
expr="//div[@name='div_name']/t[first()]"

Upvotes: 1

Related Questions