Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5027 Lượt xem

Hi everyone,

With this developpement, I just wan't to show rounded numbers in My TimeSheets.

Actually, my js file is launched but It seem's like openerp.new_module (see here under) 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,

Simon

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You might want to check the following link. Found it through linkedin: Inheriting javascript from OpenERP 7 web client

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
5581
1
thg 3 15
5059
10
thg 4 23
34319
5
thg 12 22
29499
20
thg 2 21
103083