This question has been flagged
2 Replies
4207 Views

When I replace custom footer and intall website blog that module try to find a div inside the footer which I don't want to use:.

Error details:

The element '<xpath expr="//div[@id='info']/ul">'coulnd't be found in father's view

Context Error :

Vista `Footer News Blog Link`
[view_id: 1239, xml_id: n/a, model: n/a, parent_id: 734]" while parsing None:13, near
<data inherit_id="website.footer_default" name="Footer News Blog Link">
<xpath expr="//div[@id='info']/ul" position="inside">
<li><a t-attf-href="/blog/%(website_blog.blog_blog_1)d">News</a></li>
</xpath>
</data>

<template id="theme_custom_footer" name="Custom Footer" inherit_id="website.footer_default">
<xpath expr="//div[@class='container hidden-print']" position="replace">
<div class="container_footer" style="background-color: #d0d0d1;border-top: 4px solid #428bca;">
                My footer
</div>
</xpath>
</template>

Avatar
Discard
Author Best Answer

I've to add the div to the replace div "container hidden-print". But I didn't want that funcionality from the web_blog module, core developers should think in don't crash system when the xpath is not found.

Avatar
Discard

I have updated my answer. You just need to make your module depends on website_blog.

Best Answer

Hi,

When your inheritance of template website.footer_default is changed entire structure of the DIV with class "container hidden-print". But same template is inherited by website_blog module and put some information inside "div[@id='info']/ul". So, website_blog do not get the particular XPATH inside parent view due to your inheritance and replace entire DIV.

So, you have to take care while replace inside any template. To avoid such kind of error you have to inherit templates and replace its content which are dependent on the main template.

Update : Another solution : You just need to put website_blog module inside your 'depends' list of __openerp__.py file.

I hope it is clear to you. If you have any question please write it down.

Thanks.

Avatar
Discard