How to resolve: ValueError: can only parse strings

    Traceback (most recent call last):
  File "/trytond/wsgi.py", line 73, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 347, in fields_view_get
    result['field_childs'])
  File "/trytond/model/modelview.py", line 462, in _view_look_dom_arch
    fields_width=fields_width)
  File "/trytond/model/modelview.py", line 627, in __view_look_dom
    fields_width=fields_width, fields_attrs=fields_attrs)
  File "/trytond/model/modelview.py", line 627, in __view_look_dom
    fields_width=fields_width, fields_attrs=fields_attrs)
  File "/trytond/model/modelview.py", line 627, in __view_look_dom
    fields_width=fields_width, fields_attrs=fields_attrs)
  File "/trytond/model/modelview.py", line 564, in __view_look_dom
    views = get_views(relation, view_ids, mode)
  File "/trytond/model/modelview.py", line 541, in get_views
    Relation.fields_view_get(view_type=view_type))
  File "/trytond/model/modelview.py", line 298, in fields_view_get
    tree = etree.fromstring(result['arch'], parser=parser)
  File "src/lxml/etree.pyx", line 3236, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1875, in lxml.etree._parseMemoryDocument
ValueError: can only parse strings

How can i resolve this bug??

Probably the file of the XML view does not exist (or it is empty).

Either the filename in the “name” field of the view, or the filename in view/xxxx.xml is wrong.

As the message is not clear enough, I filled Issue 9940: Better error message when XML is missing for a view - Tryton issue tracker

2 Likes