Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Factura electrónica. Error de pyafipws al momento de Validar factura.

por
Leonardo
en 1/9/16 14:51 1.062 vistas

Buenos dias.

Escribo para consultarles sobre un problema que estoy teniendo desde hace unos dias y no puedo resolver. Soy nuevo en ODOO quizas es un error clasico. 

Ambiente: ODOO lo tengo instalado en Ubuntu 14.04 plano (sin docker).
                Localizacion argentina instalada y modulos de factura electronica. Hice un "pull" actualizando todas las versiones.

El problema: Tengo descargado e importado el certificado de respuesta de WS AFIP HOMOLOGACION con exito, desde el formulario de "AFIP" >>"Punto de Venta" verifico con exito la conexion y servicios. 

Ahora, cuando hago clic en "Chequear numeros Locales/Remotos"

Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/http.py", line 544, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 581, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 317, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 314, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 810, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 410, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 948, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 936, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 268, in wrapper return old_api(self, *args, **kwargs)

File "/opt/odoo/odoo-server/openerp/api.py", line 399, in old_api result = method(recs, *args, **kwargs) File "/opt/odoo/custom/addons/l10n_ar_afipws_fe/models/afip_point_of_sale.py", line 44, in check_document_local_remote_number j_document_class.get_pyafipws_last_invoice()['result']) + 1

File "/opt/odoo/odoo-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/custom/addons/l10n_ar_afipws_fe/models/journal_afip_document_class.py", line 88, in get_pyafipws_last_invoice document_class, point_of_sale.number)

File "/usr/local/lib/python2.7/dist-packages/pyafipws/utils.py", line 150, in capturar_errores_wrapper return func(self, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/pyafipws/wsfev1.py", line 322, in CompUltimoAutorizado CbteTipo=tipo_cbte,

File "/usr/local/lib/python2.7/dist-packages/pyafipws/wsfev1.py", line 111, in __analizar_errores self.ErrCode = ' '.join([str(error['Err']['Code']) for error in errores])

KeyError: 'code'
 

Desoyendo este error, genere una factura elec. y al momento de hacer clic en "Validar en HOMOLOGACION" me tira el siguiente dump de error:

Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/http.py", line 544, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 581, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 317, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 314, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 810, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 410, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 955, in exec_workflow return request.session.exec_workflow(model, id, signal) File "/opt/odoo/odoo-server/openerp/http.py", line 1118, in exec_workflow r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id) File "/opt/odoo/odoo-server/openerp/http.py", line 886, in proxy_method result = dispatch_rpc(self.service_name, method, args) File "/opt/odoo/odoo-server/openerp/http.py", line 115, in dispatch_rpc result = dispatch(method, params) File "/opt/odoo/odoo-server/openerp/service/model.py", line 37, in dispatch res = fn(db, uid, *params) File "/opt/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 188, in exec_workflow return exec_workflow_cr(cr, uid, obj, signal, *args) File "/opt/odoo/odoo-server/openerp/service/model.py", line 182, in exec_workflow_cr return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id] File "/opt/odoo/odoo-server/openerp/service/model.py", line 164, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/odoo/odoo-server/openerp/api.py", line 268, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3571, in signal_workflow result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr) File "/opt/odoo/odoo-server/openerp/workflow/__init__.py", line 85, in trg_validate return WorkflowService.new(cr, uid, res_type, res_id).validate(signal) File "/opt/odoo/odoo-server/openerp/workflow/service.py", line 91, in validate res2 = wi.validate(signal) File "/opt/odoo/odoo-server/openerp/workflow/instance.py", line 80, in validate wi.process(signal=signal, force_running=force_running, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 120, in process ok = self._split_test(activity['split_mode'], signal, stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 248, in _split_test self._join_test(t[0], t[1], stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 257, in _join_test WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 95, in create workflow_item.process(stack=stack) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 116, in process if not self._execute(activity, stack): File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 162, in _execute returned_action = self.wkf_expr_execute(activity) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 313, in wkf_expr_execute return self.wkf_expr_eval_expr(activity['action']) File "/opt/odoo/odoo-server/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr result = eval(line, env, nocopy=True) File "/opt/odoo/odoo-server/openerp/tools/safe_eval.py", line 314, in safe_eval return eval(c, globals_dict, locals_dict) File "", line 1, in <module> File "/opt/odoo/odoo-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/custom/addons/l10n_ar_afipws_fe/models/invoice.py", line 168, in action_number self.do_pyafipws_request_cae() File "/opt/odoo/odoo-server/openerp/api.py", line 266, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/custom/addons/l10n_ar_afipws_fe/models/invoice.py", line 202, in do_pyafipws_request_cae doc_afip_code, pos_number)

File "/usr/local/lib/python2.7/dist-packages/pyafipws/utils.py", line 150, in capturar_errores_wrapper return func(self, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/pyafipws/wsfev1.py", line 322, in CompUltimoAutorizado CbteTipo=tipo_cbte, File "/usr/local/lib/python2.7/dist-packages/pyafipws/wsfev1.py", line 111, in __analizar_errores self.ErrCode = ' '.join([str(error['Err']['Code']) for error in errores])

ValueError: "code" while evaluating u'action_number()'

 

* A alguien le ha pasado algo similar o me puede "tirar" alguna ayuda ?

* Existe alguna forma, que no sea tocando el codigo fuente, para ver el XML que se arma y se envia a la AFIP y lo mismo con el response del XML que llega de AFIP ?

Cualquier comentario, asi sea para encaminarme, me servira. 

Desde ya muchas gracias !

Leonardo

 


0
Nicolas Cordi
En 9/9/16 23:36

Hola Leonardo, podrias guiarme paso a paso como solucionarlo ? tengo exactamente el mismo error que vos.



0
Leonardo
En 5/9/16 19:47

Ya fue resuelto, me "autocontesto" para que quede registrado:

El problema es que los de AFIP agregaron un warning en la respuesta de ese método que dice: "IMPORTANTE: El 01/11/2016 se renovarán los certificados SSL utilizados por los webservices de AFIP. Los nuevos certificados utilizarán el algoritmo de encriptación SHA-2. Para más información http://www.afip.gob.ar/ws/comoAfectaElCambio.asp  y el método analizar_errores de PyAfipWS no lo atrapa bien.

saludos

  • Marcar

Hola Leonardo, como lo resolviste? Ya que hay que actualizar los certificados si o si en los próximos días.

Sebastián Garillo
de 6/9/16 11:06

Hola Sebastian. Lo reporte al desarrollador de pyAFIPWS y ya fue corregido. Simplemente tenes que hacen un "pull" para bajar los cambios y luego correr el install de setup.py Espero haberte ayudado. Saludos Leonardo

Leonardo
de 8/9/16 17:02

Mantener informado

Acerca de esta comunidad

Esta comunidad es para profesionales y entusiastas de nuestros productos y servicios, compartir los mejores contenidos y nuevas ideas de marketing, construir su perfil profesional y mejorar el mercado para todos. Lea las directrices

Herramientas de las preguntas

42 seguidor(es)

Estadísticas

Preguntado: 1/9/16 14:51
Visto: 1062 veces
Última actualización: 14/4/18 12:41