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

Hello,

I want to override parseFloatTime() method of field_utils.js in web module odoo14. For that i have followed to links:-

link1

link2

but not getting override in my custom module.

Also here is my code which i have tried following the above links:-


odoo.define('custom_module_name.field_utils.float_time', function (require) {

"use strict";

// override float_time function

var field_utils = require('web.field_utils');


function parseFloatTime(value) {

    var factor = 1;

    if (value[0] === '-') {

        value = value.slice(1);

        factor = -1;

    }

    if(value){

    var float_time_pair = value.split(":");

    if (float_time_pair.length !== 2)

        return factor * parseFloat(value);

    var hours = parseInteger(float_time_pair[0]);

    var minutes = parseInteger(float_time_pair[1]);

    return factor * (hours + (minutes / 60));

    }

}


field_utils.parse.float_time = parseFloatTime;

});


So can anyone help me on this problem please?

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

Did you had the solution?


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 22
2362
1
thg 8 23
3003
0
thg 5 23
3248
1
thg 1 23
8036
Override JS mail Đã xử lý
3
thg 7 21
5307