[Trunk/6.1.1] UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128)

Bug #1029316 reported by Marcos Garcia
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

Hello,

I was creating an invoice through the web client, so I was creating a new invoice line, when typing the name of the accountancy account with an accent "prestación" (not really sure if this is the correct name in english, i'm Spanish), an error appeared:

Client Traceback (most recent call last):
  File "/opt/server/openerp/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/opt/server/openerp/addons/web/controllers/main.py", line 1039, in call
    return self.call_common(req, model, method, args, domain_id, context_id)
  File "/opt/server/openerp/addons/web/controllers/main.py", line 991, in call_common
    return self._call_kw(req, model, method, args, {})
  File "/opt/server/openerp/addons/web/controllers/main.py", line 1005, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/server/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/opt/server/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/opt/server/openerp/addons/web/common/http.py", line 611, in send
    raise fault

Server Traceback (most recent call last):
  File "/opt/server/openerp/addons/web/common/http.py", line 592, in send
    result = openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_20120709_233338-py2.6.egg/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/server/openerp/addons/account/account.py", line 577, in name_search
    ids = self.search(cr, user, [('code', operator, operand1), ('name', operator, operand2)]+ args, limit=limit)
  File "/opt/server/openerp/addons/account/account.py", line 226, in search
    args[pos] = ('code', '=like', str(args[pos][2].replace('%', ''))+'%')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128)

Related branches

summary: - [6.1.1] UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3'
- in position 8: ordinal not in range(128)
+ [Trunk/6.1.1] UnicodeEncodeError: 'ascii' codec can't encode character
+ u'\xf3' in position 8: ordinal not in range(128)
affects: openerp-web → openobject-addons
Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Amit Parik (amit-parik)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Manu.

Thanks for the reporting!

Your issue has been fixed on lp:~openerp-dev/openobject-addons/trunk-bug-1029316-amp branch with following rev id and rev no.

Rev Id : <email address hidden>
Rev no : 7139

It will merge with trunk soon.

Thanks again!

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Marcos Garcia (marcosgdf) wrote :

Well, my name is Marcos, but thank you anyway : - D

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

fixed in trunk, thanks for reporting.
r7613

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Jacara (baskhuujacara) wrote :

Hello

I checked this issue with addon revision 7052. But I'm still facing this problem.

Traceback (most recent call last):
  File "/home/jacara/server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/jacara/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/jacara/server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/jacara/addons/account/account.py", line 577, in name_search
    ids = self.search(cr, user, [('code', operator, operand1), ('name', operator, operand2)]+ args, limit=limit)
  File "/home/jacara/addons/account/account.py", line 226, in search
    args[pos] = ('code', '=like', str(args[pos][2].replace('%', ''))+'%')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)

I'm using mn_MN language (Mongolian). And I'm searching some account unicode name on many2one widget. str method does not correct for me.

Why this bug didn't fixed on 6.1 stable version?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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