Merge lp:~openerp-dev/openobject-client-web/6.0-opw-55168-msh into lp:openobject-client-web

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Merged at revision: 4837
Proposed branch: lp:~openerp-dev/openobject-client-web/6.0-opw-55168-msh
Merge into: lp:openobject-client-web
Diff against target: 41 lines (+11/-2)
2 files modified
addons/openerp/validators.py (+10/-1)
lib/populate.sh (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/6.0-opw-55168-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+91802@code.launchpad.net

Description of the change

Hello,

Fixed the issue of cherrypy version, the version of cherrypy > 3.1.2 is causing following problem.

Just run populate.sh which will install latest version cherrypy due to which following issue is faced.

Issue - 1 create group by of any list view and try to expan the groups.

Issue - 2 Go to HR -> Employee -> edit any employee -> change the photo -> save it, binary data will not be saved.

Fixed the issue to make fix cherrypy less than 3.1.2, if we use cherrypy <= 3.1.2 then it works smoothly, cherrypy greater than 3.1.2 creates many problems.

Thanks.

To post a comment you must log in.
Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

The issue has been fixed in https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-574491-xal/+merge/104766.

Hence abstain this branch.

Thanks.

Revision history for this message
Xavier ALT (dex-phx) wrote :

Hi,

Group by problem was fixed, but saving binary field with cherrypy >= 3.2.X are still broken.

Fact is, cherrpy >= 3.2.X are wrapping POST binary content inside cherrypy._cpreqbody.Part class, whereas the web client currently only take cgi.FieldStorage class into account. I will fix that before merging it.

Cheers,
Xavier

4762. By Xavier ALT

[FIX] web: fix saving of binary fields with cherrypy >= 3.2.X

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/openerp/validators.py'
--- addons/openerp/validators.py 2012-01-06 11:29:16 +0000
+++ addons/openerp/validators.py 2012-06-21 19:10:25 +0000
@@ -25,6 +25,15 @@
25import re25import re
26import time26import time
2727
28BINARY_FIELD_STORAGE_CLASS = cgi.FieldStorage
29try:
30 # binary data send/get with cherrypy >= 3.2.X
31 # are wrapper inside 'Part' class
32 from cherrypy._cpreqbody import Part
33 BINARY_FIELD_STORAGE_CLASS = ( cgi.FieldStorage, Part )
34except ImportError:
35 pass
36
28import formencode.validators37import formencode.validators
29import formencode.api38import formencode.api
3039
@@ -159,7 +168,7 @@
159 if isinstance(value, list):168 if isinstance(value, list):
160 value = value[0]169 value = value[0]
161170
162 if isinstance(value, cgi.FieldStorage):171 if isinstance(value, BINARY_FIELD_STORAGE_CLASS):
163 if value.filename:172 if value.filename:
164 return base64.encodestring(value.file.read())173 return base64.encodestring(value.file.read())
165 elif self.not_empty:174 elif self.not_empty:
166175
=== modified file 'lib/populate.sh'
--- lib/populate.sh 2009-11-06 12:53:43 +0000
+++ lib/populate.sh 2012-06-21 19:10:25 +0000
@@ -6,7 +6,7 @@
6 test $2 || PYTHONPATH=. easy_install -a -Z -d . $16 test $2 || PYTHONPATH=. easy_install -a -Z -d . $1
7}7}
88
9install "CherryPy>=3.1.2" "-d cherrypy"9install "CherryPy<=3.1.2" "-d cherrypy"
10install "Babel>=0.9.4" "-d babel"10install "Babel>=0.9.4" "-d babel"
11install "Mako>=0.2.4" "-d mako"11install "Mako>=0.2.4" "-d mako"
12install "simplejson>=2.0.9" "-d simplejson"12install "simplejson>=2.0.9" "-d simplejson"