[6.1 / trunk] survey module not fully unicode aware

Bug #1052079 reported by Stéphane Bidoul (Acsone)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 1

Bug Description

Hello,

When using non-ascii characters in survey answers (for fields of type comment), the surveys cannot be viewed using the "Browse Answer" function.

How to reproduced in 6.1:
1. openerp 6.1 with survey module and demo data
2. Go to Tools > Surveys > Answer Surveys > Answer a Survey
3. Select survey "Initial Partner Feedback"
4. On page 2 enter accents (é, for instance) for question "Why?"
5. clock done
6. Go to Tools > Reporting > Surveys > Browse Answers
7. Select survey "Initial Partner Feedback"
8. click next and you get the following stack trace

OpenERP Server Error
Client Traceback (most recent call last):
  File "/opt/openerp/web/6.1/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/opt/openerp/web/6.1/addons/web/controllers/main.py", line 1065, in default_get
    return Model.default_get(fields, req.session.eval_context(req.context))
  File "/opt/openerp/web/6.1/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/opt/openerp/web/6.1/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/opt/openerp/web/6.1/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/openerp/web/6.1/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp/server/6.1/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/server/6.1/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/6.1/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/server/6.1/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/server/6.1/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/addons/6.1-fixes/audittrail/audittrail.py", line 495, in execute_cr
    return fct_src(cr, uid, model, method, *args)
  File "/opt/openerp/server/6.1/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/addons/6.1-fixes/survey/wizard/survey_answer.py", line 502, in default_get
    value[field] = str(que.comment)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128)

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Reading the code, this also applies to trunk. Changing the title accordingly. These str() calls everywhere in the module can't possibly work.

summary: - survey module not unicode aware
+ [6.1 / trunk] survey module not unicode aware
summary: - [6.1 / trunk] survey module not unicode aware
+ [6.1 / trunk] survey module not fully unicode aware
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

lp:1039895 is similar although not exactly the same manifestation.

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jalpesh Patel(OpenERP) (pja-openerp) wrote :

Hello,

        It has been Fixed in https://bugs.launchpad.net/openobject-addons/+bug/1052079
        Revision No:7544
        Revision ID: <email address hidden>

Thanks,
 pja

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.