跳至內容
選單
此問題已被標幟
1 回覆
3688 瀏覽次數

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?

頭像
捨棄
最佳答案

Did you had the solution?


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
5月 22
2357
1
8月 23
3000
0
5月 23
3244
1
1月 23
8034
3
7月 21
5305