需要一些帮助来扩展openerp JS“模块”

时间:2013-04-15 11:08:27

标签: javascript openerp

通过这个开发,我只想在My TimeSheets中显示舍入的数字。

实际上,我的JS文件已经启动,但似乎永远不会调用openerp.new_module(见下文)。

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;
        },

    });
};

提前多多感谢。

0 个答案:

没有答案