Odoo Help

Welcome!

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.

1

Need some help to extend js "module"

By
Simon Rolin
on 4/15/13, 9:04 AM 1,326 views

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

0

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
On 5/13/13, 9:07 PM

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

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)

Stats

Asked: 4/15/13, 9:04 AM
Seen: 1326 times
Last updated: 3/16/15, 8:10 AM