Odoo Help

Welcome!

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.

0

JavaScript: Calling _super() on the parent of the parent

By
Sajad KK
on 9/16/14, 4:53 AM 728 views

I need to override a JavaScript function in OpenERP 7, to disable some code which I don't need (to hide "Print" button and auto printing). Unfortunately this function calls _super on a parent class, so I also need to call it but without calling the function I'm trying to substitute. How can I call _super on the parent of the parent class? Both extend() and include() produce the same result in this case.

This is my complete code:

openerp.pos_test = function(instance) {
    var module = instance.point_of_sale;
    var _t = instance.web._t;


    module.ReceiptScreenWidget.include({
        show: function(){
            //this._super();

            var self = this;

            this.add_action_button({
                label: _t('Next Order'),
                icon: '/point_of_sale/static/src/img/icons/png48/go-next.png',
                click: function() { self.finishOrder(); },
            });
        },
    });
}

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)

Stats

Asked: 9/16/14, 4:53 AM
Seen: 728 times
Last updated: 3/16/15, 8:10 AM