Aqeeb Imtiaz Harun
Aqeeb Imtiaz Harun

Reputation: 167

Element '<xpath expr="//head/link[last()]">' cannot be located in parent view every time trying to extend portal.frontend_layout in Odoo 14

In Odoo 14, I'm trying to add some templates that inherits portal.frontend_layout. But it's throwing 'Element <xpath expr="//head/link[last()]"> cannot be located in parent view' error.

The portal.frontend_layout template inherits web.frontend_layout, where I can see that //head/link[last()] code is there & the inherited web.layout DOES have link inside head tag.

Is it an issue on the base code? or something wrong in my inherited view?

This is my sample code:

<template id="website_menu_header_customized" 
        inherit_id="portal.frontend_layout" 
        name="Header Language Link">
....
</template>

Upvotes: 0

Views: 1026

Answers (2)

MohitGhodasara
MohitGhodasara

Reputation: 2742

You have to inherit web.frontend_layout instead of portal.frontend_layout because portal.frontend_layout doesn't have any head tag.

You can not directly use XPath for the template's parent template.

Upvotes: 1

AnJ
AnJ

Reputation: 614

Make sure that you have portal mentioned as a dependency inside your manifest file.

You could also try replacing portal with web directly.

Upvotes: 1

Related Questions