Odoo Help


How to 'customize' the website sustainably?

Frank Adler
on 8/23/14, 2:49 AM 1,082 views


I've found that my 'inline changes' in the Odoo website frontend persist during upgrages, but changes done through the 'customize' option get overwritten. This seems to be the case as the customize option actually changes the underlying view which gets (potentially) overwritten during an upgrade.

What is the correct way to change the content in the website front-end, in order for changes (be it 'in-line' or through 'customize') to remain in place during an upgrade?


Anders Wallenquist
On 8/24/14, 5:40 AM

You have to create a module with your changes. You can use "Customize" as a RAD-editor and when your ready recreate your additions as xpath-templates in your module.

Thanks Anders. Maybe I misunderstand, but wouldn't your reply mean that for instance to add a simple "id" or a "class" tag to an existing div or p tag (to modify its css, or to alternatively add an inline style tag) I need to reference that through xpath in an inherited view and use 'replace'? Surely there has to be a better way? Especially since the xpath would change as soon as I modify the website inline...?

Frank Adler
on 8/24/14, 8:43 AM

If you create a "view"/template in a new module with: Here comes your HTML and t-commands. If you want to change a page: <xpath expr="//div[@name='my_postion']" position="after">

Your code comes here
You can also create snippets that you call with or what you called your snipped. A module makes it easier to recreate your site in another database and preserve what you done when you upgrade and reinstall generic modules.

Anders Wallenquist
on 8/24/14, 10:16 AM

Code does not look well in commens. Have a look at the website_crm-module instead (two inherits and one new page): https://github.com/odoo/odoo/blob/master/addons/website_crm/views/website_crm.xml

Anders Wallenquist
on 8/24/14, 10:19 AM

This is how we have done on sites we have created. Instead of xpath and replace you can overwrite the whole page and use the same id as the original page. I think there are a positon-parameter you can add to ensure that you are the last contributor. I donẗ know if its better to overwrite or change (xpath). We have had a lot of problems with xpath and t.call/inherits that does not find anything when upgrading thru saas[12345] and 8x. But its better to know where your code are and not burried in a nonfunctional database IMHO.

Anders Wallenquist
on 8/24/14, 10:33 AM

For us the bootstrap framework has forced us to relearn how to create a site. Today we have another approach than earlier and seldom create our own classes, just change them in a "theme".

Anders Wallenquist
on 8/24/14, 10:38 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/23/14, 2:49 AM
Seen: 1082 times
Last updated: 3/16/15, 8:10 AM