Odoo Help


Odoo 9 theme tutorial - Javascript Options code results in "Uncaught ReferenceError: openerp is not defined"

Francis Williams
on 3/18/16, 11:31 AM 1,938 views

I am trying to complete the Odoo 9 theme tutorial located here https://www.odoo.com/documentation/9.0/howtos/themes.html

I having a problem with the "javascript options" section, specifically using the code provided I get the exception "Uncaught ReferenceError: openerp is not defined".

I have tried to read around the problem, but cannot find anybody with the same issue. I have however read in other documentation that the "openerp" global variable has been removed. If this is the case what is best practice for achieving the intent of the tutorial in this section?

I have also had problems with other parts of the tutorial which I have been able to solve through other resources.

Maybe use odoo global variable ?

Jérémy Kersten (jke)
on 3/19/16, 5:27 AM

I have tried this already, the "odoo" variable has no "Website" property, and nothing that is clear, as far as I can see, that replaces it.

Francis Williams
on 3/19/16, 1:33 PM
On 4/20/16, 5:56 AM

odoo.define('snippet_testimonial_options',function(require) {

    'use strict';

    var options = require('web_editor.snippets.options');


on_focus: function(){

                          alert("On focus!")




one month later..., same response that below..
Without uses of code tag... :/

Jérémy Kersten (jke)
on 4/20/16, 8:39 AM

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/19/16, 3:11 PM


Sorry the doc for v9 theme seems to be not already updated.

Find below an example:

odoo.define('foo.bar', function (require) {
'use strict';
var website = require('website.website');
var options = require('web_editor.snippets.options');
options.registry.bar = s_options.Class.extend({
start: function () {
var self = this;
this.$content = this.$target.find('.lorem');

In any case,s you can easily find many example in addons website (website/static/src/js/) and others modules (website_*)

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

3 follower(s)


Asked: 3/18/16, 11:31 AM
Seen: 1938 times
Last updated: 4/20/16, 5:56 AM