OpusVL / odoo-mgmtsystem

Porting openerp-mgmtsystem (original in Launchpad) to odoo v8
3 stars 4 forks source link

Encoding-related error on click Send for Analysis on a Nonconformity #3

Closed Nick-OpusVL closed 10 years ago

Nick-OpusVL commented 10 years ago
Traceback (most recent call last):
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 476, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 495, in dispatch
    result = self._call_function(**self.params)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 311, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 308, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 685, in __call__
    return self.method(*args, **kw)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 360, in response_wrap
    response = f(*args, **kw)
  File "/home/nick.booker/cu/ep/m/oe/addons/web/controllers/main.py", line 952, in exec_workflow
    return request.session.exec_workflow(model, id, signal)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 988, in exec_workflow
    r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 759, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/http.py", line 93, in dispatch_rpc
    result = dispatch(method, params)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 37, in dispatch
    res = fn(db, uid, *params)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 183, in exec_workflow
    return exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 177, in exec_workflow_cr
    return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/service/model.py", line 159, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/api.py", line 233, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/models.py", line 3467, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/__init__.py", line 85, in trg_validate
    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/service.py", line 91, in validate
    res2 = wi.validate(signal)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/instance.py", line 75, in validate
    wi.process(signal=signal, force_running=force_running, stack=stack)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 120, in process
    ok = self._split_test(activity['split_mode'], signal, stack)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 248, in _split_test
    self._join_test(t[0], t[1], stack)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 257, in _join_test
    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 95, in create
    workflow_item.process(stack=stack)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 116, in process
    if not self._execute(activity, stack):
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 162, in _execute
    returned_action = self.wkf_expr_execute(activity)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 313, in wkf_expr_execute
    return self.wkf_expr_eval_expr(activity['action'])
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr
    result = eval(line, env, nocopy=True)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/tools/safe_eval.py", line 312, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/api.py", line 231, in wrapper
    return new_api(self, *args, **kwargs)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/api.py", line 548, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/home/nick.booker/cu/ep/m/src/odoo-mgmtsystem/mgmtsystem_nonconformity/mgmtsystem_nonconformity.py", line 228, in wkf_analysis
    self.case_send_note(cr, uid, ids, _('Analysis'), data=data, context=context)
  File "/home/nick.booker/cu/ep/odoo/odoo/openerp/api.py", line 233, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/nick.booker/cu/ep/m/src/odoo-mgmtsystem/mgmtsystem_nonconformity/mgmtsystem_nonconformity.py", line 214, in case_send_note
    post = _('\n<br />\n<ul><li> <b>Stage:</b> %s \xe2\x86\x92 %s</li></ul>') % (o.state, data['state'])
ValueError: "ascii
%s \u2192 %s</li></ul>
3
4
ordinal not in range(128)" while evaluating
u'wkf_analysis()'
Nick-OpusVL commented 10 years ago

I've partially fixed this by making msg and post into 'unicode' literals. Commit fc70eaa

However, we're now left with odd-looking characters in the messages.

2014-08-26-143558_693x201_scrot

Nick-OpusVL commented 10 years ago

Fixed in commit 09a6fa9