Odoo Help


Problem overwriting Odoo Javascript

Jose M
on 9/4/14, 4:35 AM 1,701 views


Since Odoo minify all JS, if i have two functions with same name, for the same view but in different modules, Odoo will execute the last one minified.

The order of minifying  JS is alphabetical with the name of the module, so in order to execute  the overwritten function I have to name the module after the original, to get my JS the last one in the minified JS file.

An example:

My code


openerp.great_project = function(instance) {
    var _t = instance.web._t, _lt = instance.web._lt;
    var QWeb = instance.web.qweb;


        compute_cards_auto_height : function() {
              NEW CODE



Odoo code


openerp.web_kanban = function (instance) {

var _t = instance.web._t,
   _lt = instance.web._lt;
var QWeb = instance.web.qweb;
instance.web.views.add('kanban', 'instance.web_kanban.KanbanView');

instance.web_kanban.KanbanView = instance.web.View.extend({
    template: "KanbanView",
    display_name: _lt('Kanban'),
    default_nr_columns: 1,
    view_type: "kanban",
    quick_create_class: "instance.web_kanban.QuickCreate",
    number_of_color_schemes: 10,

compute_cards_auto_height: function() {
        if (!this.view.group_by) {
            var min_height = 0;
            var els = [];
            _.each(this.records, function(r) {
                var $e = r.$el.children(':first:not(.oe_kanban_no_auto_height)').css('min-height', 0);
                if ($e.length) {
                    min_height = Math.max(min_height, $e.outerHeight());
            $(els).css('min-height', min_height);



I dont know if there is a solution to this problem, just want to know what do you do in these cases.

Thank for your time, Jose Maria.

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: 9/4/14, 4:35 AM
Seen: 1701 times
Last updated: 3/16/15, 8:10 AM