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.


Another TypeError: ClientWidget is null

anonymous 2183
on 5/6/14, 5:45 AM 2,800 views

I'm new to openerp, and try to build a web module by following doc.openerp.com/trunk/web/module/ step by step, now the problem is when I began to change action to instance.web.Widget.extend

instance.web_example.Action = instance.web.Widget.extend({
    className: 'oe_web_example',
    start: function () {
        // this.$el.text("Hello, world!");
        console.log("Executed the action", action);
        return this._super();

when I click the menu i got this error , TypeError: ClientWidget is null, I double checked the javascript file and __openerp__.py which is exactly identical to the document.

The database was clean and no other module installed but this one.

Any one any idea?



| 5 4 7
Bikaner, India

OpenERP Devloper at SunARC Technology

On 5/6/14, 6:08 AM

Following doc.openerp.com/trunk/web/module/ the below Code will works:-


        <record model="ir.actions.client" id="action_client_example">
            <field name="name">Example Client Action</field>
            <field name="tag">example.action</field>
        <menuitem action="action_client_example"


openerp.web_example = function (instance) {
  instance.web.client_actions.add('example.action', 'instance.web_example.Action');
instance.web_example.Action = instance.web.Widget.extend({
    className: 'oe_web_example',
    start: function () {
         this.$el.text("Hello, world!");
        //console.log("Executed the action", action); Action is not defined
        return this._super();

Thanks man. you known I just change one line of code which you comment it out, that because this.$el.text("Hello, world!") got same error. and if I change the instance.web_example.Action = function(...... , it works. BTW, I restart the server and refresh browser.

anonymous 2183
on 5/6/14, 6:26 AM

Finally sort it out, there is a inconsistent typing in the tutorial, previous one is instance.web.client_actions.add('example.action', 'instance.web_example.action', next step is instance.web.client_actions.add('example.action', 'instance.web_example.Action', thanks for the help anyway.

anonymous 2183
on 5/6/14, 12:28 PM

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

0 follower(s)


Asked: 5/6/14, 5:45 AM
Seen: 2800 times
Last updated: 3/16/15, 8:10 AM