Odoo Help


This community 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.


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

Ermin Trevisan
on 1/14/15, 3:09 AM 783 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


| 5 4 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 1/14/15, 3:09 AM
Seen: 783 times
Last updated: 2/11/16, 12:07 PM