[FIX][7.0]Fixed float_time widget show wrong format of time.

bzr revid: pan@tinyerp.com-20130122060420-7cho7hewmj80mb16
This commit is contained in:
Anand Patel (OpenERP) 2013-01-22 11:34:20 +05:30
parent f4fd5fd99c
commit 7ae392d316
1 changed files with 7 additions and 3 deletions

View File

@ -166,9 +166,13 @@ instance.web.format_value = function (value, descriptor, value_if_empty) {
value = Math.abs(value);
pattern = '-' + pattern;
}
return _.str.sprintf(pattern,
Math.floor(value),
Math.round((value % 1) * 60));
var hour = Math.floor(value);
var min = Math.round((value % 1) * 60);
if (min == 60){
min = 0;
hour = hour + 1;
}
return _.str.sprintf(pattern, hour, min);
case 'many2one':
// name_get value format
return value[1] ? value[1].split("\n")[0] : value[1];