跳至内容
菜单
此问题已终结
1 回复
3665 查看

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
2354
1
8月 23
2982
0
5月 23
3222
1
1月 23
8027
3
7月 21
5300