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.


How to call the super ._super() in javascript widgets.

Leonardo Donelli
on 6/25/14, 5:44 AM 1,296 views

I wanted to modify the start method of the Advanced Search Javascript Controller (instance.web.search.Advanced), particularly I just wanted to edit the callback function of the fields_get method, which is passed to $.when as a deferred.

The problem is that the start method calls ._super() but if I overwrite extend it (using .include() or .extend()) the ._super() function will refer to the AdvancedSearch start method at not to the start method the original ._super() calls (which is the one of instance.web.search.Input) I tried directly setting instance.web.search.Advanced.start = function() { ... } copying the whole function with the little addition in the callback, but it won't work.


Here is a little scheme to make things clearer:

search.Input:start <- search.Advanced:start <- search.MyCustomAdvanced:start

MyCustomAdvanced:start should be identical to Advanced:start except for an extra test in the callback (.done()) of the fields_get method. Advanced:start calls ._super(), which refers to Input:start. But if I just copy that ._super() in MyCustomAdvanced:start, it will refer to Advanced:start (which I don't need because I'm copying it anyway) and not to Input:start

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)


Asked: 6/25/14, 5:44 AM
Seen: 1296 times
Last updated: 3/16/15, 8:10 AM