← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 824379] Re: Cyrillic date and time format crashes the client

 

*** This bug is a duplicate of bug 816799 ***
    https://bugs.launchpad.net/bugs/816799

** This bug has been marked a duplicate of bug 816799
   Non-ascii date format crashes web client

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/824379

Title:
  Cyrillic date and time format crashes the client

Status in OpenERP Web Client:
  New

Bug description:
  OpenERP has been installed on Windows 7.
  The version of Open ERP is 6.0, downloaded from the website.
  I use Firefox.
  The localization settings of the pc are Bulgarian.

  When I open the web client and go to Administration, Users, I receive
  the following error:

  <type 'exceptions.UnicodeEncodeError'>	Python 2.5.2: C:\Program Files\OpenERP 6.0\Web\openerp-web.exe
  Thu Aug 11 11:25:53 2011

  A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
   C:\Program Files\OpenERP 6.0\Web\cherrypy\_cprequest.pyo in respond(self=<cherrypy._cprequest.Request object at 0x02A138B0>, path_info='/openerp/execute')
   C:\Program Files\OpenERP 6.0\Web\cherrypy\_cpdispatch.pyo in __call__(self=<cherrypy._cpdispatch.LateParamPageHandler object at 0x02A13F10>)
   C:\Program Files\OpenERP 6.0\Web\openobject\tools\_expose.pyo in func_wrapper(*args=(<openobject.controllers._root.Root object at 0x01126BB0>, 'openerp', 'execute'), **kw={'_': '1313051153562', 'payload': 'eJx1U8uu0zAQ_ZXZ-VaqSktvueUuQYIfgAWCq8i1J-lIjm35...KNAETZVpx42K6s-2ubpp3IU1rKbxux3iVbLt7u17_AsxnU5w='})
   C:\Program Files\OpenERP 6.0\Web\openobject\controllers\_root.pyo in default(self=<openobject.controllers._root.Root object at 0x01126BB0>, *args=('openerp', 'execute'), **kw={'_': '1313051153562', 'payload': 'eJx1U8uu0zAQ_ZXZ-VaqSktvueUuQYIfgAWCq8i1J-lIjm35...KNAETZVpx42K6s-2ubpp3IU1rKbxux3iVbLt7u17_AsxnU5w='})
   C:\Program Files\OpenERP 6.0\Web\cherrypy\_cpdispatch.pyo in __call__(self=<cherrypy._cpdispatch.LateParamPageHandler object at 0x02A7C8B0>)
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\utils.py in wrapper(*args=(), **kw={'payload': 'eJx1U8uu0zAQ_ZXZ-VaqSktvueUuQYIfgAWCq8i1J-lIjm35...KNAETZVpx42K6s-2ubpp3IU1rKbxux3iVbLt7u17_AsxnU5w='})
    110             # User is logged in; allow access
    111             clear_login_fields(kw)
    112             return fn(*args, **kw)
    113         else:
    114             action = kw.get('login_action', '')
   C:\Program Files\OpenERP 6.0\Web\openobject\tools\_expose.pyo in func_wrapper(*args=(<openerp.controllers.execute.Execute object at 0x02B65CF0>,), **kw={'payload': 'eJx1U8uu0zAQ_ZXZ-VaqSktvueUuQYIfgAWCq8i1J-lIjm35...KNAETZVpx42K6s-2ubpp3IU1rKbxux3iVbLt7u17_AsxnU5w='})
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\execute.py in index(self=<openerp.controllers.execute.Execute object at 0x02B65CF0>, payload='eJx1U8uu0zAQ_ZXZ-VaqSktvueUuQYIfgAWCq8i1J-lIjm35...KNAETZVpx42K6s-2ubpp3IU1rKbxux3iVbLt7u17_AsxnU5w=')
     17             zlib.decompress(
     18                 base64.urlsafe_b64decode(payload)))
     19         action, data = decoded_payload['action'], decoded_payload['data']
     20         cherrypy.request.params.update(decoded_payload)
     21         return actions.execute(action, **data)
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\actions.py in execute(action={'auto_refresh': 0, 'auto_search': True, 'context': u'{}', 'display_menu_tip': True, 'domain': '[]', 'filter': False, 'groups_id': [], 'help': u'Create and manage users that will connect to the... the applications they need to use in the system.', 'id': 17, 'limit': 80, ...}, **data={'context': {'client': 'web', 'lang': u'bg_BG', 'tz': False}, 'id': 35, 'ids': [35], 'limit': 20, 'model': 'ir.ui.menu', 'report_type': 'pdf', 'res_id': None, 'res_model': u'res.users', 'search_view': None, 'view_mode': u'tree,form', ...})
    384 
    385     action_executor = ACTIONS_BY_TYPE[action['type']]
    386     return action_executor(action, data)
    387 
    388 def execute_url(**data):
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\actions.py in act_window(action={'auto_refresh': 0, 'auto_search': True, 'context': u'{}', 'display_menu_tip': True, 'domain': '[]', 'filter': False, 'groups_id': [], 'help': u'Create and manage users that will connect to the... the applications they need to use in the system.', 'id': 17, 'limit': 80, ...}, data={'context': {'client': 'web', 'lang': u'bg_BG', 'tz': False}, 'id': 35, 'ids': [35], 'limit': 20, 'model': 'ir.ui.menu', 'report_type': 'pdf', 'res_id': None, 'res_model': u'res.users', 'search_view': None, 'view_mode': u'tree,form', ...})
    272                           context_menu=data.get('context_menu'),
    273                           display_menu_tip=display_menu_tip,
    274                           action_id=action.get('id'))
    275 
    276 def server(action, data):
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\actions.py in execute_window(view_ids=[8, 7], model=u'res.users', res_id=None, domain=[], view_type=u'form', context={'_terp_view_name': u'\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438', 'active_id': 35, 'active_ids': [35], 'active_model': 'ir.ui.menu', 'client': 'web', 'lang': u'bg_BG', 'search_view': 9, 'tz': False}, mode=[u'tree', u'form'], name=u'\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438', target=u'current', limit=20, search_view=None, context_menu=None, display_menu_tip=u'Create and manage users that will connect to the... the applications they need to use in the system.', action_id=17)
     86         params.view_mode=mode
     87 
     88         return Form().create(params)
     89 
     90     elif view_type == 'tree':
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\utils.py in wrapper(*args=({'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None},), **kw={})
    110             # User is logged in; allow access
    111             clear_login_fields(kw)
    112             return fn(*args, **kw)
    113         else:
    114             action = kw.get('login_action', '')
   C:\Program Files\OpenERP 6.0\Web\openobject\tools\_expose.pyo in func_wrapper(*args=(<openerp.controllers.form.Form object at 0x02B652B0>, {'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None}), **kw={})
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\form.py in create(self=<openerp.controllers.form.Form object at 0x02B652B0>, params={'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None}, tg_errors=None)
    193         if params.view_type == 'tree':
    194             params.editable = True
    195         form = self.create_form(params, tg_errors)
    196 
    197         if not tg_errors:
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\controllers\form.py in create_form(self=<openerp.controllers.form.Form object at 0x02B652B0>, params={'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None}, tg_errors=None)
    184         params.view_type = params.view_type or params.view_mode[0]
    185 
    186         return tw.form_view.ViewForm(params, name="view_form", action="/openerp/form/save")
    187 
    188     @expose(template="/openerp/controllers/templates/form.mako")
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\form_view.py in __init__(self=ViewForm, params={'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None}, **kw={'action': '/openerp/form/save', 'name': 'view_form'})
     88             
     89         self.screen = Screen(prefix='', hastoolbar=True, hassubmenu=True, editable=editable, readonly=readonly,
     90                              selectable=params.selectable or 2)
     91         
     92         if self.screen.widget and self.screen.view_type in ['form', 'tree']:
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\screen.py in __init__(self=Screen, params={'_terp_action_id': 17, '_terp_view_type': u'tre..., '_terp_view_ids': [8, 7], 'context_menu': None}, prefix='', name='', views_preloaded={}, hastoolbar=True, hassubmenu=True, editable=True, readonly=False, selectable=2, nolinks=1, **kw={})
    105         self.kalendar           = params.kalendar
    106         if self.view_mode:
    107             self.add_view_id(self.view_id, self.view_type)
    108 
    109     def add_view_id(self, view_id, view_type):
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\screen.py in add_view_id(self=Screen, view_id=8, view_type=u'tree')
    121             view = cache.fields_view_get(self.model, view_id or False, view_type, ctx, self.hastoolbar, self.hassubmenu)
    122 
    123         self.add_view(view, view_type)
    124 
    125     def add_view(self, view, view_type='form'):
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\screen.py in add_view(self=Screen, view={'arch': u'<tree string="\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438">\n ... <field name="date"/>\n </tree>', 'field_parent': False, 'fields': {'context_lang': {'help': u'\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0435\u0437\u0438\u043a \u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0441\u043a\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0433\u0430\u0442\u043e \u0438\u043c\u0430 \u0441\u044a\u043e\u0442\u0432\u0435\u0442\u043d\u0438\u0442\u0435 \u043f\u0440\u0435\u0432\u043e\u0434\u0438', 'name': u'context_lang', 'required': True, 'selectable': True, 'selection': [(u'en_US', u'English'), (u'bg_BG', u'Bulgarian / \u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a')], 'string': u'\u0415\u0437\u0438\u043a', 'type': u'selection', 'views': {}}, 'date': {'name': u'date', 'readonly': True, 'selectable': True, 'string': u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u043a\u0446\u0438\u044f', 'type': u'datetime', 'views': {}}, 'login': {'help': u'Used to log into the system', 'name': u'login', 'required': True, 'selectable': True, 'size': 64, 'string': u'\u0412\u0445\u043e\u0434', 'type': u'char', 'views': {}}, 'name': {'help': u'\u0418\u0441\u0442\u0438\u043d\u0441\u043a\u043e\u0442\u043e \u0438\u043c\u0435 \u043d\u0430 \u043d\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b, \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0442\u044a\u0440\u0441\u0435\u043d\u0435 \u0432 \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u043f\u0438\u0441\u044a\u0446\u0438', 'name': u'name', 'required': True, 'select': True, 'selectable': True, 'size': 64, 'string': u'\u0418\u043c\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b', 'type': u'char', 'views': {}}}, 'model': u'res.users', 'name': u'res.users.tree', 'submenu': False, 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'tree', 'view_id': 8}, view_type=u'tree')
    129         
    130         from _views import get_view_widget
    131         self.widget = get_view_widget(view_type, self)
    132 
    133         self.string = (self.widget or '') and self.widget.string
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\_views.py in get_view_widget(kind=u'tree', screen=Screen)
    135         raise Exception("view '%s' not supported." % kind)
    136 
    137     return view(screen)
    138 
    139 def get_registered_views():
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\_views.py in __call__(self=<openerp.widgets._views.ListView object at 0x02B65290>, screen=Screen)
    116                                     count=screen.count, nolinks=screen.link,
    117                                     m2m=screen.m2m, o2m=screen.o2m,
    118                                     default_data=screen.default_value)
    119 
    120         screen.ids = widget.ids
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\listgrid.py in __init__(self=List, name='_terp_list', model=u'res.users', view={'arch': u'<tree string="\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438">\n ... <field name="date"/>\n </tree>', 'field_parent': False, 'fields': {'context_lang': {'help': u'\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0435\u0437\u0438\u043a \u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0441\u043a\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0433\u0430\u0442\u043e \u0438\u043c\u0430 \u0441\u044a\u043e\u0442\u0432\u0435\u0442\u043d\u0438\u0442\u0435 \u043f\u0440\u0435\u0432\u043e\u0434\u0438', 'name': u'context_lang', 'required': True, 'selectable': True, 'selection': [(u'en_US', u'English'), (u'bg_BG', u'Bulgarian / \u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a')], 'string': u'\u0415\u0437\u0438\u043a', 'type': u'selection', 'views': {}}, 'date': {'name': u'date', 'readonly': True, 'selectable': True, 'string': u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u043a\u0446\u0438\u044f', 'type': u'datetime', 'views': {}}, 'login': {'help': u'Used to log into the system', 'name': u'login', 'required': True, 'selectable': True, 'size': 64, 'string': u'\u0412\u0445\u043e\u0434', 'type': u'char', 'views': {}}, 'name': {'help': u'\u0418\u0441\u0442\u0438\u043d\u0441\u043a\u043e\u0442\u043e \u0438\u043c\u0435 \u043d\u0430 \u043d\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b, \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0442\u044a\u0440\u0441\u0435\u043d\u0435 \u0432 \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u043f\u0438\u0441\u044a\u0446\u0438', 'name': u'name', 'required': True, 'select': True, 'selectable': True, 'size': 64, 'string': u'\u0418\u043c\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b', 'type': u'char', 'views': {}}}, 'model': u'res.users', 'name': u'res.users.tree', 'submenu': False, 'toolbar': {'action': [], 'print': [], 'relate': []}, 'type': u'tree', 'view_id': 8}, ids=[1], domain=[], context={'_terp_view_name': u'\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438', 'active_id': 35, 'active_ids': [35], 'active_model': 'ir.ui.menu', 'client': 'web', 'lang': u'bg_BG', 'search_view': 9, 'tz': False}, **kw={'count': 0, 'default_data': [], 'editable': True, 'limit': 20, 'm2m': 0, 'nolinks': 1, 'o2m': 0, 'offset': 0, 'selectable': 2, 'view_mode': [u'tree', u'form']})
    201 
    202         self.values = copy.deepcopy(data)
    203         self.headers, self.hiddens, self.data, self.field_total, self.buttons = self.parse(root, fields, data)
    204 
    205         for k, v in self.field_total.items():
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\listgrid.py in parse(self=List, root=<DOM Element: tree at 0x2dc4dc8>, fields={'context_lang': {'help': u'\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435 \u0435\u0437\u0438\u043a \u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0441\u043a\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0433\u0430\u0442\u043e \u0438\u043c\u0430 \u0441\u044a\u043e\u0442\u0432\u0435\u0442\u043d\u0438\u0442\u0435 \u043f\u0440\u0435\u0432\u043e\u0434\u0438', 'name': u'context_lang', 'required': True, 'selectable': True, 'selection': [(u'en_US', u'English'), (u'bg_BG', u'Bulgarian / \u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a')], 'string': u'\u0415\u0437\u0438\u043a', 'type': u'selection', 'views': {}}, 'date': {'name': u'date', 'readonly': True, 'selectable': True, 'string': u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u043a\u0446\u0438\u044f', 'type': u'datetime', 'views': {}}, 'login': {'help': u'Used to log into the system', 'name': u'login', 'required': True, 'selectable': True, 'size': 64, 'string': u'\u0412\u0445\u043e\u0434', 'type': u'char', 'views': {}}, 'name': {'help': u'\u0418\u0441\u0442\u0438\u043d\u0441\u043a\u043e\u0442\u043e \u0438\u043c\u0435 \u043d\u0430 \u043d\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b, \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u0442\u044a\u0440\u0441\u0435\u043d\u0435 \u0432 \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u043f\u0438\u0441\u044a\u0446\u0438', 'name': u'name', 'required': True, 'select': True, 'selectable': True, 'size': 64, 'string': u'\u0418\u043c\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b', 'type': u'char', 'views': {}}}, data=[{'context_lang': Selection, 'date': u'2011-08-11 11:25:21.539', 'id': 1, 'login': Char, 'name': Char}])
    410                             cell.set_value(row_value.get(name, False))
    411                         else:
    412                             cell = CELLTYPES[kind](value=row_value.get(name, False), **fields[name])
    413 
    414                         for color, expr in self.colors.items():
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\listgrid.py in __init__(self=DateTime, **attrs={'name': u'date', 'readonly': True, 'selectable': True, 'string': u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u043a\u0446\u0438\u044f', 'type': u'datetime', 'value': u'2011-08-11 11:25:21.539', 'views': {}})
    441         self.attrs = attrs.copy()
    442 
    443         self.text = self.get_text()
    444         self.link = self.get_link()
    445 
   C:\Program Files\OpenERP 6.0\Web\addons\openerp\widgets\listgrid.py in get_text(self=DateTime)
    575 
    576     def get_text(self):
    577         return format.format_datetime(self.value, kind=self.attrs.get('type', 'datetime'))
    578 
    579     def get_sortable_text(self):
   C:\Program Files\OpenERP 6.0\Web\openobject\i18n\format.pyo in format_datetime(value=(2011, 8, 11, 11, 25, 21, 3, 223, 0), kind=u'datetime', as_timetuple=False)

  <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe3' in position 9: ordinal not in range(128)
        args = ('ascii', u'%d.%m.%Y \xe3. %H:%M:%S \xf7.', 9, 10, 'ordinal not in range(128)')
        encoding = 'ascii'
        end = 10
        message = ''
        object = u'%d.%m.%Y \xe3. %H:%M:%S \xf7.'
        reason = 'ordinal not in range(128)'
        start = 9 

  
  I use Bulgarian interface for OpenERP. If I change the language to English there is no problem with the encoding.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-client-web/+bug/824379/+subscriptions


References