This question has been flagged
3 Replies
8176 Views

I have the following simple template. It works fine in the website. If I make any changes to it it upates just fine. But if I edit the name or biography fields in the website editor and save it. Changes made in the code no longer appears in the website. I have tried upgrading the module, restarting the server but nothing works. The only thing that works is to uninstall the module and reinstall it. 

<template id="biography">
            <t t-call="website.layout">
                <t t-set="title">Academy</t>
                <div class="oe_structure"/>
                <div class="oe_structure">
                    <div class="container">
                        <h3 t-field="person.name"/>
                        <div t-field="person.biography"/>
                    </div>
                </div>
                <div class="oe_structure"/>
            </t>
        </template>

Avatar
Discard
Author

Anyone???

Author

Please help. This is important.

Best Answer

Since my proposal came 6 years later and that is was urgent I guess it won't help you, but It might help someone else.

When you edit the page from the builder, it looks like odoo make a copy of it so you subsequent code updates are not more visible since odoo now rely on that copy

What I used to do is I create another template that will actually have my code and further updates. Then I call that template from the original template and I do not modify that body template anymore. Thus even when odoo copy that template (id="biograpy") it will still load "my_module.t_biograpy" that actually contains my must updated changes . 

I hope this is clear enough





























Avatar
Discard
Best Answer

A workaround would be the possibility to reset an XML template (instead of having to uninstall/reinstall, potentially losing data). In the Odoo web_editor app there is a comment "Reseting views is not supported yet". 

This limitation bugged me too long, so I created a small addon for this feature: https://github.com/ayudoo/web_editor_xml_reset

Now, you can simply reset a website XML template to installation default.

Avatar
Discard
Best Answer

It's been a long time but same situation.

I found a work around but still need 1 uninstall:

My template id is 'website.pricing'

Template is stored in ir_ui_view table, so query:

select id, type,inherit_id,key,active from ir_ui_view where key='website.pricing';

Got id of the template in this table, now DELETE it.

Now if you try to refresh browser, it may say 500 - template not found.

Uninstall and reinstall your module, that will create a new ir_ui_view record

and now, changes in template source code will be updated when module is upgraded.

Avatar
Discard