1

With this development, I just want to show rounded numbers in My TimeSheets.

Actually, my JS file is launched but it seems like openerp.new_module (see here below) is never called.

openerp.new_module = function(instance){

    var module = instance.hr_timesheet_sheet // loading the namespace of the 'sample' module

    var _super_ = module.WeeklyTimesheet.prototype.sum_box;

    module.WeeklyTimesheet.include({

        sum_box : function(){
            //_super_.call(this);  // calling the original Foo.bar() method
            var line_total = 0;
            _.each(account.days[day_count].lines, function(line) {
                line_total += line.unit_amount;
            });
            return Math.round(line_total*100)/100;
        },

    });
};

Thanks a lot in advance.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
Simon Rolin
  • 940
  • 13
  • 34
  • did you registered the js into `__openerp__.py` ? also make sure you refreshed the browser cache properly and give a look at this http://stackoverflow.com/questions/8817467/openerp-web-client-6-1-how-to-override-base-javascript-functions because certain functions need a different setup to be overridden. – simahawk Apr 15 '13 at 12:06
  • Yes, both of those have been done. This have been verified by adding window.console.log('test') before openerp.new_module and inside it. The one before was printed, the one inside not. – Simon Rolin Apr 15 '13 at 13:35

0 Answers0