Merge lp:~openerp-dev/openobject-client/6.0-opw-580557-rgo into lp:openobject-client/6.0

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 1962
Merged at revision: 1963
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-580557-rgo
Merge into: lp:openobject-client/6.0
Diff against target: 69 lines (+6/-6)
4 files modified
bin/widget/view/form_gtk/spinbutton.py (+1/-1)
bin/widget/view/form_gtk/spinint.py (+1/-1)
bin/widget_search/spinbutton.py (+2/-2)
bin/widget_search/spinint.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-580557-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+130352@code.launchpad.net

Description of the change

Hello,

From GTK-Client, when entered value above 2147483647 for integer/float fields, value reverted back to 2147483647. This is due to the limited value supported by sys.maxint, this fix removed this restriction.

Kindly review the fix.

Thanks.

To post a comment you must log in.
Naresh(OpenERP) (nch-openerp) wrote :

you forgot to remove the * import sys* which is now useless.
I will be doing while merging.

Thanks,
Naresh

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/view/form_gtk/spinbutton.py'
2--- bin/widget/view/form_gtk/spinbutton.py 2011-10-24 16:20:03 +0000
3+++ bin/widget/view/form_gtk/spinbutton.py 2012-10-18 13:34:57 +0000
4@@ -29,7 +29,7 @@
5 def __init__(self, window, parent, model, attrs={}):
6 interface.widget_interface.__init__(self, window, parent, model, attrs)
7
8- adj = gtk.Adjustment(0.0, -sys.maxint, sys.maxint, 1.0, 5.0)
9+ adj = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
10 self.widget = gtk.SpinButton(adj, 1.0, digits=int( attrs.get('digits',(14,2))[1] ) )
11 self.widget.set_activates_default(True)
12 self.widget.connect('populate-popup', self._menu_open)
13
14=== modified file 'bin/widget/view/form_gtk/spinint.py'
15--- bin/widget/view/form_gtk/spinint.py 2011-10-24 16:22:58 +0000
16+++ bin/widget/view/form_gtk/spinint.py 2012-10-18 13:34:57 +0000
17@@ -30,7 +30,7 @@
18 def __init__(self, window, parent, model, attrs={}):
19 interface.widget_interface.__init__(self, window, parent, model, attrs)
20
21- adj = gtk.Adjustment(0.0, -sys.maxint, sys.maxint, 1.0, 5.0)
22+ adj = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
23 self.widget = gtk.SpinButton(adj, 1, digits=0)
24 self.widget.set_width_chars(5)
25 self.widget.set_activates_default(True)
26
27=== modified file 'bin/widget_search/spinbutton.py'
28--- bin/widget_search/spinbutton.py 2011-08-18 11:01:28 +0000
29+++ bin/widget_search/spinbutton.py 2012-10-18 13:34:57 +0000
30@@ -32,7 +32,7 @@
31
32 self.widget = gtk.HBox(spacing=3)
33
34- adj1 = gtk.Adjustment(0.0, -sys.maxint, sys.maxint, 1.0, 5.0)
35+ adj1 = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
36 self.spin1 = gtk.SpinButton(adj1, 1.0, digits=int(attrs.get('digits', (14, 2))[1]))
37 self.spin1.set_activates_default(True)
38 self.spin1.connect('input', self.format_input)
39@@ -41,7 +41,7 @@
40
41 self.widget.pack_start(gtk.Label('-'), expand=False, fill=False)
42
43- adj2 = gtk.Adjustment(0.0, -sys.maxint, sys.maxint, 1.0, 5.0)
44+ adj2 = gtk.Adjustment(0.0, -2**100, 2**100, 1.0, 5.0)
45 self.spin2 = gtk.SpinButton(adj2, 1.0, digits=int(attrs.get('digits', (14, 2))[1]))
46 self.spin2.set_activates_default(True)
47 self.spin2.connect('input', self.format_input)
48
49=== modified file 'bin/widget_search/spinint.py'
50--- bin/widget_search/spinint.py 2011-08-18 11:01:28 +0000
51+++ bin/widget_search/spinint.py 2012-10-18 13:34:57 +0000
52@@ -35,7 +35,7 @@
53
54 self.widget = gtk.HBox(spacing=3)
55
56- adj1 = gtk.Adjustment(0.0, 0.0, sys.maxint, 1.0, 5.0)
57+ adj1 = gtk.Adjustment(0.0, 0.0, 2**100, 1.0, 5.0)
58 self.spin1 = gtk.SpinButton(adj1, 1, digits=0)
59 self.spin1.set_activates_default(True)
60 self.spin1.connect('input', self.format_input)
61@@ -44,7 +44,7 @@
62
63 self.widget.pack_start(gtk.Label('-'), expand=False, fill=False)
64
65- adj2 = gtk.Adjustment(0.0, 0.0, sys.maxint, 1.0, 5.0)
66+ adj2 = gtk.Adjustment(0.0, 0.0, 2**100, 1.0, 5.0)
67 self.spin2 = gtk.SpinButton(adj2, 1, digits=0)
68 self.spin2.set_activates_default(True)
69 self.spin2.connect('input', self.format_input)