Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How we can use this._super() to call the original method in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 336
    Comment on it

    If you want to use this._super() to call the original method in OpenERP/Odoo When overriding a method using inheritance below is the example.


    For example code look like below.

    say_hello: function () {
        setTimeout(function () {
            this._super();
        }.bind(this), 0);
    }
    
    // correct
    say_hello: function () {
        // don't forget .bind()
        var _super = this._super.bind(this);
        setTimeout(function () {
            _super();
        }.bind(this), 0);
    }
    

    Note-It is a reference to its value should be retained, it should not be accessed via this.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: