v6 menu Etapes UnicodeEncodeError

Bug #610072 reported by GEM
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Chirag Patel (OpenERP)

Bug Description

works in client gtk
french language
sales->configuration->sales->leads and oppportunities->steps

 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\addons\openerp\widgets\form_view.py in __init__(self=ViewForm, params={'_terp_view_type': u'tree', '_terp_offset': 0, ...active_id': 270}, '_terp_view_ids': [488, False]}, **kw={'action': '/openerp/form/save', 'name': 'view_form'})
   89 if params.view_type in ('tree', 'graph'):
   90 self.search = Search(model=params.model, domain=search_param, context=params.context, values=params.search_data or {},
   91 filter_domain=params.filter_domain or [], search_view=params.search_view, group_by_ctx=params.group_by_ctx or [])
   92
   93 cherrypy.request.custom_search_domain = self.search.listof_domain or []
filter_domain undefined, params = {'_terp_view_type': u'tree', '_terp_offset': 0, ...active_id': 270}, '_terp_view_ids': [488, False]}, params.filter_domain = None, search_view undefined, params.search_view = {'arch': u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u"Nom de l'\xe9tape", 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'on_change': {'help': 'Change Probability on next and previous stages.', 'selectable': True, 'string': 'Change Probability Automatically', 'type': 'boolean'}, 'probability': {'required': True, 'selectable': True, 'string': 'Probability (%)', 'type': 'float'}, 'requirements': {'selectable': True, 'string': 'Requirements', 'type': 'text'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}, 'sequence': {'help': 'Gives the sequence order when displaying a list of case stages.', 'selectable': True, 'string': u'S\xe9quence', 'type': 'integer'}}, 'model': 'crm.case.stage', 'name': u'crm.case.stage.form', 'type': u'form', 'view_id': 489}, group_by_ctx undefined, params.group_by_ctx = None
 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\openobject\widgets\_meta.py in wrapper(self=Search, *args=(), **kw={'context': {'_terp_view_name': u'Stages', 'active_id': 270, 'active_ids': [270], 'active_model': 'ir.ui.menu', 'client': 'web', 'department_id': False, 'lang': u'fr_FR', 'object_id': 'crm.lead', 'project_id': False, 'section_id': False, ...}, 'domain': [], 'filter_domain': [], 'group_by_ctx': [], 'model': u'crm.case.stage', 'search_view': {'arch': u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u"Nom de l'\xe9tape", 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'on_change': {'help': 'Change Probability on next and previous stages.', 'selectable': True, 'string': 'Change Probability Automatically', 'type': 'boolean'}, 'probability': {'required': True, 'selectable': True, 'string': 'Probability (%)', 'type': 'float'}, 'requirements': {'selectable': True, 'string': 'Requirements', 'type': 'text'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}, 'sequence': {'help': 'Gives the sequence order when displaying a list of case stages.', 'selectable': True, 'string': u'S\xe9quence', 'type': 'integer'}}, 'model': 'crm.case.stage', 'name': u'crm.case.stage.form', 'type': u'form', 'view_id': 489}, 'values': {}})
   38 self.__initstack.append(1)
   39
   40 res = func(self, *args, **kw)
   41 try:
   42 self.__initstack.pop()
res undefined, func = <function __init__ at 0x01C25430>, self = Search, args = (), kw = {'context': {'_terp_view_name': u'Stages', 'active_id': 270, 'active_ids': [270], 'active_model': 'ir.ui.menu', 'client': 'web', 'department_id': False, 'lang': u'fr_FR', 'object_id': 'crm.lead', 'project_id': False, 'section_id': False, ...}, 'domain': [], 'filter_domain': [], 'group_by_ctx': [], 'model': u'crm.case.stage', 'search_view': {'arch': u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u"Nom de l'\xe9tape", 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'on_change': {'help': 'Change Probability on next and previous stages.', 'selectable': True, 'string': 'Change Probability Automatically', 'type': 'boolean'}, 'probability': {'required': True, 'selectable': True, 'string': 'Probability (%)', 'type': 'float'}, 'requirements': {'selectable': True, 'string': 'Requirements', 'type': 'text'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}, 'sequence': {'help': 'Gives the sequence order when displaying a list of case stages.', 'selectable': True, 'string': u'S\xe9quence', 'type': 'integer'}}, 'model': 'crm.case.stage', 'name': u'crm.case.stage.form', 'type': u'form', 'view_id': 489}, 'values': {}}
 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\addons\openerp\widgets\search.py in __init__(self=Search, model=u'crm.case.stage', domain=[], context={'_terp_view_name': u'Stages', 'active_id': 270, 'active_ids': [270], 'active_model': 'ir.ui.menu', 'client': 'web', 'department_id': False, 'lang': u'fr_FR', 'object_id': 'crm.lead', 'project_id': False, 'section_id': False, ...}, values={}, filter_domain=[], search_view={'arch': u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u"Nom de l'\xe9tape", 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'on_change': {'help': 'Change Probability on next and previous stages.', 'selectable': True, 'string': 'Change Probability Automatically', 'type': 'boolean'}, 'probability': {'required': True, 'selectable': True, 'string': 'Probability (%)', 'type': 'float'}, 'requirements': {'selectable': True, 'string': 'Requirements', 'type': 'text'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}, 'sequence': {'help': 'Gives the sequence order when displaying a list of case stages.', 'selectable': True, 'string': u'S\xe9quence', 'type': 'integer'}}, 'model': 'crm.case.stage', 'name': u'crm.case.stage.form', 'type': u'form', 'view_id': 489}, group_by_ctx=[])
  272 self.fields_list.sort(lambda x, y: cmp(x[1], y[1]))
  273
  274 dom = xml.dom.minidom.parseString(self.search_view['arch'])
  275 self.view_type = dom.firstChild.localName
  276 self.string = dom.documentElement.getAttribute('string')
dom undefined, global xml = <module 'xml' from 'd:\OpenERP AllInOne\Web\python25\lib\xml\__init__.py'>, xml.dom = <module 'xml.dom' from 'd:\OpenERP AllInOne\Web\python25\lib\xml\dom\__init__.py'>, xml.dom.minidom = <module 'xml.dom.minidom' from 'd:\OpenERP AllInOne\Web\python25\lib\xml\dom\minidom.py'>, xml.dom.minidom.parseString = <function parseString at 0x01A40670>, self = Search, self.search_view = {'arch': u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u"Nom de l'\xe9tape", 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'on_change': {'help': 'Change Probability on next and previous stages.', 'selectable': True, 'string': 'Change Probability Automatically', 'type': 'boolean'}, 'probability': {'required': True, 'selectable': True, 'string': 'Probability (%)', 'type': 'float'}, 'requirements': {'selectable': True, 'string': 'Requirements', 'type': 'text'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}, 'sequence': {'help': 'Gives the sequence order when displaying a list of case stages.', 'selectable': True, 'string': u'S\xe9quence', 'type': 'integer'}}, 'model': 'crm.case.stage', 'name': u'crm.case.stage.form', 'type': u'form', 'view_id': 489}
 d:\OpenERP AllInOne\Web\python25\lib\xml\dom\minidom.py in parseString(string=u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', parser=None)
 1923 if parser is None:
 1924 from xml.dom import expatbuilder
 1925 return expatbuilder.parseString(string)
 1926 else:
 1927 from xml.dom import pulldom
expatbuilder = <module 'xml.dom.expatbuilder' from 'd:\OpenERP AllInOne\Web\python25\lib\xml\dom\expatbuilder.py'>, expatbuilder.parseString = <function parseString at 0x03D72430>, string = u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>'
 d:\OpenERP AllInOne\Web\python25\lib\xml\dom\expatbuilder.py in parseString(string=u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', namespaces=True)
  938 else:
  939 builder = ExpatBuilder()
  940 return builder.parseString(string)
  941
  942
builder = <xml.dom.expatbuilder.ExpatBuilderNS instance at 0x03D01738>, builder.parseString = <bound method ExpatBuilderNS.parseString of <xml...atbuilder.ExpatBuilderNS instance at 0x03D01738>>, string = u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>'
 d:\OpenERP AllInOne\Web\python25\lib\xml\dom\expatbuilder.py in parseString(self=<xml.dom.expatbuilder.ExpatBuilderNS instance at 0x03D01738>, string=u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>')
  221 parser = self.getParser()
  222 try:
  223 parser.Parse(string, True)
  224 self._setup_subset(string)
  225 except ParseEscape:
parser = <pyexpat.xmlparser object at 0x0420D6F0>, parser.Parse = <built-in method Parse of pyexpat.xmlparser object at 0x0420D6F0>, string = u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', builtin True = True

<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xc9' in position 37: ordinal not in range(128)
      args = ('ascii', u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>', 37, 38, 'ordinal not in range(128)')
      encoding = 'ascii'
      end = 38
      message = ''
      object = u'<?xml version="1.0" ?>\n<form string="\xc9tape">\n ...ection_id" select="1" widget="selection"/></form>'
      reason = 'ordinal not in range(128)'
      start = 37

Revision history for this message
GEM (nimp3) wrote :
Download full text (9.0 KiB)

same path->categories too the same error unicode

 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\addons\openerp\widgets\form_view.py in __init__(self=ViewForm, params={'_terp_view_type': u'tree', '_terp_offset': 0, ...ment_id': False}, '_terp_view_ids': [491, False]}, **kw={'action': '/openerp/form/save', 'name': 'view_form'})
   89 if params.view_type in ('tree', 'graph'):
   90 self.search = Search(model=params.model, domain=search_param, context=params.context, values=params.search_data or {},
   91 filter_domain=params.filter_domain or [], search_view=params.search_view, group_by_ctx=params.group_by_ctx or [])
   92
   93 cherrypy.request.custom_search_domain = self.search.listof_domain or []
filter_domain undefined, params = {'_terp_view_type': u'tree', '_terp_offset': 0, ...ment_id': False}, '_terp_view_ids': [491, False]}, params.filter_domain = None, search_view undefined, params.search_view = {'arch': u'<?xml version="1.0" ?>\n<form string="Cat\xe9gorie d...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u'Nom de la cat\xe9gorie du cas', 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}}, 'model': 'crm.case.categ', 'name': u'crm.case.categ.form', 'type': u'form', 'view_id': 490}, group_by_ctx undefined, params.group_by_ctx = None
 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\openobject\widgets\_meta.py in wrapper(self=Search, *args=(), **kw={'context': {'_terp_view_name': u'Cat\xe9gories', 'active_id': 268, 'active_ids': [268], 'active_model': 'ir.ui.menu', 'client': 'web', 'department_id': False, 'lang': u'fr_FR', 'project_id': False, 'section_id': False, 'tz': False}, 'domain': [], 'filter_domain': [], 'group_by_ctx': [], 'model': u'crm.case.categ', 'search_view': {'arch': u'<?xml version="1.0" ?>\n<form string="Cat\xe9gorie d...ection_id" select="1" widget="selection"/></form>', 'field_parent': False, 'fields': {'name': {'required': True, 'selectable': True, 'size': 64, 'string': u'Nom de la cat\xe9gorie du cas', 'translate': True, 'type': 'char'}, 'object_id': {'context': {}, 'domain': [], 'relation': 'ir.model', 'selectable': True, 'string': 'Object Name', 'type': 'many2one'}, 'section_id': {'context': {}, 'domain': [], 'relation': 'crm.case.section', 'selectable': True, 'string': 'Sales Team', 'type': 'many2one'}}, 'model': 'crm.case.categ', 'name': u'crm.case.categ.form', 'type': u'form', 'view_id': 490}, 'values': {}})
   38 self.__initstack.append(1)
   39
   40 res = func(self, *args, **kw)
   41 try:
   42 self.__initstack.pop()
res undefined, func = <function __init__ at 0x01C25430>, self = Search, args = (), kw = {'context': {'_terp_view_name': u'Cat\xe9gories', 'active_i...

Read more...

description: updated
Revision history for this message
GEM (nimp3) wrote :

idem :
sales->configuration->/address book->categories
sales->configuration->/address book->localisation->state (région)
sales->configuration->/address book->events->state of mind (état d'esprit)
sales->configuration->meetings->categories

.........

Revision history for this message
Chirag Patel (OpenERP) (cpa-openerp) wrote :

Hello,
  This is fixed in lp:~openerp-dev/openobject-client-web/trunk-dev-web branch at rev.no : 3614.
  it will be merged soonly in this branch.

 if you want to solve it in trunk branch.you can just change the code in openerp/widgets/search.py
 at line 274.
 dom = xml.dom.minidom.parseString(self.search_view['arch'].encode('utf-8'))

 Thanks.

Changed in openobject-client-web:
status: New → Fix Committed
assignee: nobody → cpa(OpenERP) (cpa-openerp)
Revision history for this message
GEM (nimp3) wrote :

Sorry, but this doesn't work for the form view with special caracters.
Bye.

Revision history for this message
GEM (nimp3) wrote :

I see the form and tree 1second and after the error's message if this can help you.

Revision history for this message
GEM (nimp3) wrote :
Download full text (11.8 KiB)

works for submenus and menu I described before,
but same problem now with by example :

sales->opportunities (opportunités)
the error :

 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\addons\openerp\widgets\form_view.py in __init__(self=ViewForm, params={'_terp_view_type': u'tree', '_terp_offset': 0, ...}, '_terp_view_ids': [530, 529, 531, 530, False]}, **kw={'action': '/openerp/form/save', 'name': 'view_form'})
   89 if params.view_type in ('tree', 'graph'):
   90 self.search = Search(model=params.model, domain=search_param, context=params.context, values=params.search_data or {},
   91 filter_domain=params.filter_domain or [], search_view=params.search_view, group_by_ctx=params.group_by_ctx or [])
   92
   93 cherrypy.request.custom_search_domain = self.search.listof_domain or []
filter_domain undefined, params = {'_terp_view_type': u'tree', '_terp_offset': 0, ...}, '_terp_view_ids': [530, 529, 531, 530, False]}, params.filter_domain = None, search_view undefined, params.search_view = {'arch': '<search string="Search Opportunities">\n ... </group>\n </search>', 'field_parent': False, 'fields': {'active': {'selectable': True, 'string': 'Active', 'type': 'boolean'}, 'birthdate': {'selectable': True, 'size': 64, 'string': 'Birthdate', 'type': 'char'}, 'categ_id': {'context': {}, 'domain': "[('section_id','=',section_id), ('object_id.model', '=', 'crm.lead')]", 'relation': 'crm.case.categ', 'selectable': True, 'selection': [(4, u'Client existant'), (5, u'G\xe9n\xe9ration automatique'), (6, u'Employ\xe9'), (7, u'Partenaire'), (8, u'Campagne'), (9, u'Site internet'), (10, u'Word of mouth'), (11, u'Autre'), (False, '')], 'string': 'Lead Source', 'type': 'many2one', 'views': {}}, 'city': {'selectable': True, 'size': 128, 'string': 'City', 'type': 'char'}, 'company_id': {'context': {}, 'domain': [], 'relation': 'res.company', 'select': 1, 'selectable': True, 'selection': [(1, u'OpenERP S.A.')], 'string': 'Company', 'type': 'many2one', 'views': {}}, 'country_id': {'context': {}, 'domain': [], 'relation': 'res.country', 'selectable': True, 'string': 'Country', 'type': 'many2one', 'views': {}}, 'create_date': {'readonly': True, 'selectable': True, 'string': 'Creation Date', 'type': 'datetime', 'views': {}}, 'date_action': {'selectable': True, 'string': 'Next Action Date', 'type': 'date'}, 'date_action_last': {'readonly': 1, 'selectable': True, 'string': 'Last Action', 'type': 'datetime'}, 'date_action_next': {'readonly': 1, 'selectable': True, 'string': 'Next Action', 'type': 'datetime'}, ...}, 'model': 'crm.lead', 'name': u'CRM - Opportunities Search', 'type': u'search', 'view_id': 532}, group_by_ctx undefined, params.group_by_ctx = None
 d:\OpenERP AllInOne\Web\python25\lib\site-packages\openobject_web-5.2dev-py2.5.egg\openobject\widgets\_meta.py in wrapper(self=Search, *args=(), **kw={'context': {'_terp_view_name': u'Opportunities', 'active_id': 283, 'active_ids': [283], 'active_model': 'ir.ui.menu', 'client': 'web', 'default_type': 'opportunity', 'department_id': False, 'lang': u'fr_FR', 'project_id': False, 'search_default_current'...

Revision history for this message
Chirag Patel (OpenERP) (cpa-openerp) wrote :

Hello,
   This is fixed in lp:~openerp-dev/openobject-client-web/trunk-dev-web branch at rev.no : 3616

Thanks.

Revision history for this message
GEM (nimp3) wrote :

It works.
Thanks

Revision history for this message
GEM (nimp3) wrote :

sorry, but now the button request doesn't work :

Traceback (most recent call last):
  File "netsvc.pyo", line 401, in dispatch
  File "service\web_services.pyo", line 584, in dispatch
  File "osv\osv.pyo", line 57, in wrapper
  File "osv\osv.pyo", line 133, in execute
  File "osv\osv.pyo", line 123, in execute_cr
  File "osv\orm.pyo", line 1635, in fields_view_get
  File "osv\orm.pyo", line 1297, in __view_look_dom_arch
  File "osv\orm.pyo", line 1284, in __view_look_dom
  File "lxml.etree.pyx", line 641, in lxml.etree._Element.set (src/lxml/lxml.etree.c:9596)
  File "apihelpers.pxi", line 416, in lxml.etree._setAttributeValue (src/lxml/lxml.etree.c:31761)
  File "apihelpers.pxi", line 1136, in lxml.etree._utf8 (src/lxml/lxml.etree.c:37215)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes

Revision history for this message
Chirag Patel (OpenERP) (cpa-openerp) wrote :

Hello GEM,

Yes you are correct we got same error as you, But it seems that the problem occurs from server/addons side not from web client.

Note: There is no search view defined for request object and so it through the error.

Thanks.

affects: openobject-client-web → openobject-server
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

GEM,
The original issue you reported seems fixed.
The consequent error you receive is due to server.
You may post your views on https://bugs.launchpad.net/openobject-server/+bug/613721.
Thanks.

affects: openobject-server → openobject-client-web
Changed in openobject-client-web:
status: Fix Committed → Fix Released
milestone: none → 6.0
Revision history for this message
GEM (nimp3) wrote :

It's ok for me.
thanks.
bye

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.