Skip to Content
Menu
This question has been flagged
1 Reply
7671 Views

In order to change the Odoo branding, I have made a simple module and try to inherit the website footer copyright template.

This is the original view:

<?xml version="1.0"?>

<data inherit_id="website.layout" name="Footer Copyright">

<xpath expr="//div[contains(@id, 'footer')]" position="inside">

<div class="container mt16 mb8">

<div class="pull-right" t-ignore="true" t-if="not editable">

Create a <a href="http://www.odoo.com/page/website-builder">free website</a> with

<a class="label label-danger" href="http://www.odoo.com/page/website-builder">Odoo</a>

</div>

<div class="pull-left text-muted" itemscope="itemscope" itemtype="http://schema.org/Organization">

Copyright &amp;copy; <span t-field="res_company.name" itemprop="name">Company name</span>

</div>

</div>

</xpath>

</data>

 and this is what I tried to do:

<openerp>

<data>

<template id="tw_layout_footer_copyright" inherit_id="website.layout_footer_copyright">

<xpath expr="//div[@class='container mt16 mb8']/div[@class='pull-right']" position="replace"/>

<div class="pull-right" t-ignore="true" t-if="not editable">

Powered by <a class="label label-danger" href="http://www.odoo.com">Odoo</a>,

provided by <a class="label label-danger" href="http://www.twanda.com">twanda AG</a>.

</div>

<xpath expr="//div[@class='pull-left text-muted']" position="replace"/>

<div class="pull-left text-muted">

Copyright &amp;copy; <span t-esc="time.strftime('%Y')"></span> <span t-field="res_company.name">Company name</span>

</div>

</template>

</data>

</openerp>

This is the error I got:

ParseError: "Invalid view definition

Error details:
Element '<div class="pull-right" t-ignore="true" t-if="not editable">' cannot be located in parent view

Error context:
View `tw_layout_footer_copyright`
[view_id: 520, xml_id: n/a, model: n/a, parent_id: 234]
None" while parsing None:4, near
<data inherit_id="website.layout_footer_copyright">
                <xpath expr="//div[@class='container mt16 mb8']/div[@class='pull-right']" position="replace"/>
 			<div class="pull-right" t-ignore="true" t-if="not editable">
	   	             Powered by <a class="label label-danger" href="http://www.odoo.com">Odoo</a>,
	                     provided by <a class="label label-danger" href="http://www.twanda.com">twanda AG</a>.
 	     	        </div>
		<xpath expr="//div[@class='pull-left text-muted']" position="replace"/>
			<div class="pull-left text-muted">
		             Copyright &amp;copy; <span t-esc="time.strftime('%Y')"/> <span t-field="res_company.name">Company name</span>
 		        </div>
        </data>

Avatar
Discard
Best Answer

<openerp>

<data>

<template id="tw_layout_footer_copyright" inherit_id="website.layout">

<xpath expr="//div[@class='container mt16 mb8']/div[@class='pull-right']" position="replace">

<div class="pull-right" t-ignore="true" t-if="not editable">

Powered by <a class="label label-danger" href="http://www.odoo.com">Odoo</a>,

provided by <a class="label label-danger" href="http://www.twanda.com">twanda AG</a>.

</div>

</xpath>

<xpath expr="//div[@class='pull-left text-muted']" position="replace">

<div class="pull-left text-muted">

Copyright &amp;copy; <span t-esc="time.strftime('%Y')"></span> <span t-field="res_company.name">Company name</span>

</div>

</xpath>

</template>

</data>

</openerp>

Avatar
Discard
Author

Thank you very much, it works, but now I have a double copyright footer, that means that the original copyright footer website.layout_footer_copyright which I can find under Settings/Technical/User Interface/Views is not being replaced.

Related Posts Replies Views Activity
0
Jan 24
39
1
Jun 19
8366
1
Nov 18
8359
6
Dec 23
20349
2
Feb 24
3488