Odoo Help


Uncaught ReferenceError: openerp is not defined

Gopakumar N G
on 3/12/15, 3:37 AM 4,446 views

I have created a module named test_module with the following structure:


  • __init__.py
  • __openerp__.py
  • Views:
  • static
    -- src
         -- js
               -- test.js
  • controllers
      -- main.py
  • data
       -- data.xml

And in the template.xml I have specified the JS file as follows in a template

    <template id="test_template">
                <script type="text/javascript" language="JavaScript" src="/gastro_website/static/src/js/gastro_registration.js"/>

               <t t-call="website.layout">





 and the test.js file is

openerp.test_module = function (instance, local) {



But on loading the page for the template shows in console of the browser:

    Uncaught ReferenceError: openerp is not defined

which is from the test.js file

How to fix this?


were you able to solve this problem?

Md. Tanzilul Hasan Khan
on 7/11/17, 7:44 AM
David Bertha
On 7/14/15, 9:13 AM

You should add the script by inheriting website.assets_frontend

<template id="assets_frontend" inherit_id="website.assets_frontend" name="My scripts">
<xpath expr="." position="inside">
<script type="text/javascript" src="..."></script>

I have added the script by inheriting website.assets_frontend, but it didn't resolve the problem.

Gopakumar N G
on 6/1/16, 2:45 AM

I think it should be website.assets_editor and not frontend

Lindsay Slazakowski
on 6/21/16, 1:58 PM

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

4 follower(s)


Asked: 3/12/15, 3:37 AM
Seen: 4446 times
Last updated: 7/11/17, 7:44 AM