Chirag Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-581438-cpa into lp:openerp-web/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-581438-cpa/+merge/132882

Hello,

Float_time widget show wrong format of time.

Demo: Human Resources > Time Tracking > Timesheets
1) Create new record.
2) sign-in and sign out directly.
3) Enter 8 quntity in Timesheet Lines record and save.

It try to convert this float value 7.9988888888888887

Observed: "Difference" field value "07:60".
Expected: "Difference" field value "08:00".

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-581438-cpa/+merge/132882
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-581438-cpa.
=== modified file 'addons/web/static/src/js/formats.js'
--- addons/web/static/src/js/formats.js	2012-07-03 14:02:51 +0000
+++ addons/web/static/src/js/formats.js	2012-11-05 12:49:22 +0000
@@ -128,9 +128,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];

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to