Odoo Help


Website Builder: How to add a line in the < head section

Ermin Trevisan
on 1/14/15, 3:09 AM 1,451 views

I have a multi-database setup and need to add the following line

< script type="text/javascript" src="http://age-verify.com/js/opaque.18.js">< /script>

to the < head section which should be executed for a particular database only. I have tried it using the Chrome developer tool but to no avail. I'm a beginner, so I'm happy about any hints.

For the moment, this is a quick and dirty solution for an age verification modal on an odoo website. The javascript should ask for the age confirmation and set a cookie if successful, at best where ever a user lands on the website, if too complicated, it's also enough if it is only on the home page.

When going the module route, I would like to extend the module later for a proper age verification based on company, verification type, (country), product category and concerned landing pages.

@Ermin, I'd recommend putting together a very basic custom module to do this. This way you can just install the module on the database you need to add this for and you'll be good to go. I'd be happy to provide some basic instructions and a link to an example if you like. Could you explain some more details about where you would like to use this javascript (eg. frontend Website CMS - home page). This will help me to provide a suitable answer for your question. Putting together a basic module to add things like custom javascript and css is remarkably easy once you have an understanding of the basic framework of a module and how to inherit with xpath.

Luke Branch
on 1/14/15, 3:57 AM

I have amended my question.

Ermin Trevisan
on 1/14/15, 6:00 AM


| 6 5 7
Lodz, Poland

On 1/14/15, 5:37 AM

You must define static files in view. In custom module executed for a particular database only. This link should help you: https://www.odoo.com/forum/help-1/question/how-css-and-js-inheritance-works-on-odoo-v8-55278#answer-55282

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: 1/14/15, 3:09 AM
Seen: 1451 times
Last updated: 2/11/16, 12:07 PM