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
1=== modified file 'addons/openerp/validators.py'
2--- addons/openerp/validators.py 2012-01-06 11:29:16 +0000
3+++ addons/openerp/validators.py 2012-06-21 19:10:25 +0000
4@@ -25,6 +25,15 @@
5 import re
6 import time
7
8+BINARY_FIELD_STORAGE_CLASS = cgi.FieldStorage
9+try:
10+ # binary data send/get with cherrypy >= 3.2.X
11+ # are wrapper inside 'Part' class
12+ from cherrypy._cpreqbody import Part
13+ BINARY_FIELD_STORAGE_CLASS = ( cgi.FieldStorage, Part )
14+except ImportError:
15+ pass
16+
17 import formencode.validators
18 import formencode.api
19
20@@ -159,7 +168,7 @@
21 if isinstance(value, list):
22 value = value[0]
23
24- if isinstance(value, cgi.FieldStorage):
25+ if isinstance(value, BINARY_FIELD_STORAGE_CLASS):
26 if value.filename:
27 return base64.encodestring(value.file.read())
28 elif self.not_empty:
29
30=== modified file 'lib/populate.sh'
31--- lib/populate.sh 2009-11-06 12:53:43 +0000
32+++ lib/populate.sh 2012-06-21 19:10:25 +0000
33@@ -6,7 +6,7 @@
34 test $2 || PYTHONPATH=. easy_install -a -Z -d . $1
35 }
36
37-install "CherryPy>=3.1.2" "-d cherrypy"
38+install "CherryPy<=3.1.2" "-d cherrypy"
39 install "Babel>=0.9.4" "-d babel"
40 install "Mako>=0.2.4" "-d mako"
41 install "simplejson>=2.0.9" "-d simplejson"