Community mailing list archives

community@mail.odoo.com

Re: Replacing an entire template

by
Ryan Cole
- 03/23/2016 20:58:34
It worked perfectly after adding an inherit_id attribute, thank you very much Pedro.

Just to clarify: I've added a custom footer template that already includes a copyright notice, but Odoo was adding an extra one via website.layout_footer_copyright. It seems that the developers made some very interesting assumptions about how people would customize their websites.


Cheers,
Ryan

On Thu, Mar 24, 2016 at 1:22 PM, pedro cachaca <pcachaca33@gmail.com> wrote:
You can just override the template:

<template id="website.layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright">
    <xpath expr="//footer" position="inside">
        <div class="container-fluid mt16 mb8">
            <!-- <div class="pull-left text-muted">
                Copyright &amp;copy; <span t-esc="res_company.brand_name"/>
            </div> -->
        </div>
    </xpath>
</template>

 


On Thu, Mar 24, 2016 at 12:52 AM, MGinshe <mginshe@gmail.com> wrote:
Is it possible to completely override a <template> definition from a theme module? I'm building a website, and would like to completely remove/replace the website.layout_footer_copyright template. What I've tried so far:

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

<template id="website.layout_footer_copyright"></template>

<template id="override_footer" inherit_id="website.layout_footer_copyright">
    <xpath expr="." position="replace">
        <div></div>
    </xpath>
</template>

None of the above tests have worked (either throwing errors, or not doing anything). 

I'm aware that I could use xpath to find the relevant html tag, and replace it that way - but there are several other templates that I'd like to replace and I need an elegant, simple solution.


Cheers,
Ryan

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe