This question has been flagged
3 Replies
3475 Views

Greetings, I'm testing Ecuador localization and when I want to export a simplified transactional Annex I get this error:


Odoo Server Error

Traceback (most recent call last):

File "/home/gio666/odoo/openerp/http.py", line 537, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/gio666/odoo/openerp/http.py", line 574, in dispatch

result = self._call_function(**self.params)

File "/home/gio666/odoo/openerp/http.py", line 310, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/gio666/odoo/openerp/service/model.py", line 118, in wrapper

return f(dbname, *args, **kwargs)

File "/home/gio666/odoo/openerp/http.py", line 307, in checked_call

return self.endpoint(*a, **kw)

File "/home/gio666/odoo/openerp/http.py", line 803, in __call__

return self.method(*args, **kw)

File "/home/gio666/odoo/openerp/http.py", line 403, in response_wrap

response = f(*args, **kw)

File "/home/gio666/odoo/addons/web/controllers/main.py", line 948, in call_button

action = self._call_kw(model, method, args, {})

File "/home/gio666/odoo/addons/web/controllers/main.py", line 936, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/home/gio666/odoo/openerp/api.py", line 250, in wrapper

return old_api(self, *args, **kwargs)

File "/home/gio666/odoo/addons/l10n_ec_withdrawing/wizard/wizard_ats.py", line 286, in act_export_ats

etree.SubElement(ventaEst, 'codEstab').text = j.auth_id.serie_emision

File "lxml.etree.pyx", line 951, in lxml.etree._Element.text.__set__ (src/lxml/lxml.etree.c:46353)

File "apihelpers.pxi", line 695, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:20953)

File "apihelpers.pxi", line 683, in lxml.etree._createTextNode (src/lxml/lxml.etree.c:20829)

File "apihelpers.pxi", line 1391, in lxml.etree._utf8 (src/lxml/lxml.etree.c:27100)

TypeError: Argument must be bytes or unicode, got 'bool'


Why this error? Does it something to do with the line etree.SubElement (ventaEst, 'codEstab'). Text = File j.auth_id.serie_emision in file wizard_ats.py?? 

I'm using odoo 8 in Ubuntu 14.04 LTS

Avatar
Discard
Best Answer

Your error is because j.auth_id.serie_emision is False and you cannot assign that value to an etree element node, you could solve it like this:

etree.SubElement(ventaEst, 'codEstab').text = j.auth_id.serie_emision or ''

or using a conditional expression:

if j.auth_id.serie_emision:
etree.SubElement(ventaEst, 'codEstab').text = j.auth_id.serie_emision
Avatar
Discard
Author

the first line worked, but now i get this error: Error de Datos El sistema generó el XML pero los datos no pasan la validación XSD del SRI. Los errores mas comunes son: * RUC,Cédula o Pasaporte contiene caracteres no válidos. * Números de documentos están duplicados. El siguiente error contiene el identificador o número de documento en conflicto: Element 'IdInformante': [facet 'length'] The value has a length of '5'; this differs from the allowed length of '13'.

That is another error not related with this post

Author Best Answer

that solved the first error ... now i get a new error:


Error de Datos

El sistema generó el XML pero los datos no pasan la validación XSD del SRI.

Los errores mas comunes son:

* RUC,Cédula o Pasaporte contiene caracteres no válidos.

* Números de documentos están duplicados.

El siguiente error contiene el identificador o número de documento en conflicto:

Element 'IdInformante': [facet 'length'] The value has a length of '5'; this differs from the allowed length of '13'.




Avatar
Discard