Search code examples
odoo-11

How xpath can search with class name of a div(s)


How to search for all DIVs with a specific class name via xpath I'm currently using the following code:

    <template id="external_layout_boxed" inherit_id="web.external_layout_boxed">


        <xpath expr="//div[@class='header']" position="replace">
            <t>
                xxxxxx
            </t>
        </xpath>

    </template>

Solution

  • Searching through all the Odoo plugins I finally found the answer :

    <template id="external_layout_boxed" inherit_id="web.external_layout_boxed">
    
    
        <xpath expr="//div[hasclass('header')]" position="replace">
            <t>
                xxxxxx
            </t>
        </xpath>
    
    </template>