Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
9892 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Tác giả

Anyone???

Tác giả

Please help. This is important.

Câu trả lời hay nhất

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





























Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 22
6884
1
thg 6 21
5152
0
thg 9 18
3710
2
thg 9 17
6898
4
thg 5 25
1422