Merge lp:~openerp-dev/openobject-client/6.1-opw-576759-rgo into lp:openobject-client/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Rejected
Rejected by: Naresh(OpenERP)
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-576759-rgo
Merge into: lp:openobject-client/6.1
Diff against target: 34 lines (+3/-3)
2 files modified
bin/widget/view/form_gtk/float_time.py (+2/-2)
bin/widget/view/tree_gtk/parser.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-576759-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+114567@code.launchpad.net

Description of the change

Hello,

There is an issue with float_time widget of GTK-Client, it uses locale format instead of OpenERP locale format.

Steps to reproduce:
1) Set the 'Decimal Separator' of Language to other than dot(.),
2) after installing hr_timesheet module, go to 'Human Resources/Time Tracking/Timesheet Lines' and give value for 'Quantity' with user's locale 'Decimal Separator',

For example, with 'Decimal Separator' set to *, enter value for 'Quantity' 1*5, which should be parsed to 01:30 instead it is parsed to 15:00.

This fix fixes this issue, kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

This merge proposal is a duplicate of your own MP
https://code.launchpad.net/~openerp-dev/openobject-client/6.1-opw-576759-rgo/+merge/114566

rejecting this one for the sake of clarity on LP.

Thanks,
Naresh

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/widget/view/form_gtk/float_time.py'
--- bin/widget/view/form_gtk/float_time.py 2011-04-20 09:31:42 +0000
+++ bin/widget/view/form_gtk/float_time.py 2012-07-12 06:15:26 +0000
@@ -28,7 +28,7 @@
2828
29import common29import common
30import interface30import interface
31from tools import datetime_util31from tools import user_locale_format, datetime_util
3232
33class float_time(interface.widget_interface):33class float_time(interface.widget_interface):
34 def __init__(self, window, parent, model, attrs={}, label=None):34 def __init__(self, window, parent, model, attrs={}, label=None):
@@ -50,7 +50,7 @@
50 if text and ':' in text:50 if text and ':' in text:
51 return round(int(text.split(':')[0]) + int(text.split(':')[1]) / 60.0,4)51 return round(int(text.split(':')[0]) + int(text.split(':')[1]) / 60.0,4)
52 else:52 else:
53 return locale.atof(text)53 return user_locale_format.str2float(text)
54 except:54 except:
55 pass55 pass
56 return 0.056 return 0.0
5757
=== modified file 'bin/widget/view/tree_gtk/parser.py'
--- bin/widget/view/tree_gtk/parser.py 2011-10-20 07:08:15 +0000
+++ bin/widget/view/tree_gtk/parser.py 2012-07-12 06:15:26 +0000
@@ -505,7 +505,7 @@
505 if text and ':' in text:505 if text and ':' in text:
506 return round(int(text.split(':')[0]) + int(text.split(':')[1]) / 60.0,4)506 return round(int(text.split(':')[0]) + int(text.split(':')[1]) / 60.0,4)
507 else:507 else:
508 return locale.atof(text)508 return user_locale_format.str2float(text)
509 except:509 except:
510 pass510 pass
511 return 0.0511 return 0.0

Subscribers

People subscribed via source and target branches