Anandkumar (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/7.0-opw-581438-port-pan into lp:openerp-web/7.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/7.0-opw-581438-port-pan/+merge/144217

Hello,

Float_time widget show wrong format of time.

Demo: Human Resources > Time Tracking > Time sheets
1) Create new record.
3) Enter 5.9999 quantity in Time-sheet Lines record and save.

Observed: "Difference" field value "05:60".
Expected: "Difference" field value "06:00".

And i used Math.round,
because Math.floor is not solving the problem.
 if we uses Math.floor(4.9999) output is ==> 04:59 and
 if we uses Math.round(4.9999) output is ==> 05:00

Attached video for 
that:-https://docs.google.com/open?id=0B0jT5NnR2uk-UzBNTGQ1UFRHcjg

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/7.0-opw-581438-port-pan/+merge/144217
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/7.0-opw-581438-port-pan.
=== modified file 'addons/web/static/src/js/formats.js'
--- addons/web/static/src/js/formats.js	2012-11-29 00:22:00 +0000
+++ addons/web/static/src/js/formats.js	2013-01-22 06:13:22 +0000
@@ -166,9 +166,13 @@
                 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];

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to