Odoo Help


JQuery Disable/Override Click Event Handler in Odoo9C

on 7/19/16, 9:12 AM 518 views

In Odoo 9C, module website_quote.

I would like to override a event handler written in the website_quote, So far I have managed to override standard widgets, but however am not able to override an already overridden widget

Snippet from Standard Module (website_quote.js)

odoo.define('website_quote.website_quote', function (require) {
     'use strict';

     var ajax = require('web.ajax');
     var Widget = require('web.Widget');
     var website = require('website.website');

 // Add to SO button
 var UpdateLineButton = Widget.extend({
    events: {
        'click' : 'onClick',
    onClick: function(ev){
        var self = this;
        var href = this.$el.attr("href");
        var order_id = href.match(/order_id=([0-9]+)/);
        var line_id = href.match(/update_line\/([0-9]+)/);
        var token = href.match(/token=(.*)/);

        ajax.jsonRpc("/quote/update_line", 'call', {
            'line_id': line_id[1],
            'order_id': parseInt(order_id[1]),
            'token': token[1],
            'remove': self.$el.is('[href*="remove"]'),
            'unlink': self.$el.is('[href*="unlink"]'),
        }).then(function (data) {
        return false;

var update_button_list = [];
$('a.js_update_line_json').each(function( index ) {
    var button = new UpdateLineButton();

And In my custom module am trying to override "onClick" function of UpdateLineButton (which is already overridden from Widget). But somehow am not able achieve it.

odoo.define('MyModule.MyModule', function (require) {
     'use strict';

      var webQuote = require('website_quote.website_quote');

              events: {
                 'click' : 'onClick',

              onClick: function(ev){....}

Any help appreciated. Thanks

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 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

1 follower(s)


Asked: 7/19/16, 9:12 AM
Seen: 518 times
Last updated: 7/19/16, 9:12 AM