Hola, como estuvieron apareciendo estos días me salio un problema (creo) con el pyafipws.
Mando el error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 539, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 576, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 312, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 309, in checked_call
return self.endpoint(*a, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 805, in __call__
return self.method(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 405, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 955, in exec_workflow
return request.session.exec_workflow(model, id, signal)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1113, in exec_workflow
r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 881, in proxy_method
result = dispatch_rpc(self.service_name, method, args)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 115, in dispatch_rpc
result = dispatch(method, params)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 37, in dispatch
res = fn(db, uid, *params)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 188, in exec_workflow
return exec_workflow_cr(cr, uid, obj, signal, *args)
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 182, in exec_workflow_cr
return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]
File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3571, in signal_workflow
result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/__init__.py", line 85, in trg_validate
return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/service.py", line 91, in validate
res2 = wi.validate(signal)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/instance.py", line 80, in validate
wi.process(signal=signal, force_running=force_running, stack=stack)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 120, in process
ok = self._split_test(activity['split_mode'], signal, stack)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 248, in _split_test
self._join_test(t[0], t[1], stack)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 257, in _join_test
WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 95, in create
workflow_item.process(stack=stack)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 116, in process
if not self._execute(activity, stack):
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 162, in _execute
returned_action = self.wkf_expr_execute(activity)
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 313, in wkf_expr_execute
return self.wkf_expr_eval_expr(activity['action'])
File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr
result = eval(line, env, nocopy=True)
File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval
return eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/mnt/extra-addons/odoo-argentina/l10n_ar_afipws_fe/models/invoice.py", line 200, in action_number
self.do_pyafipws_request_cae()
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/mnt/extra-addons/odoo-argentina/l10n_ar_afipws_fe/models/invoice.py", line 351, 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
self.__analizar_errores(result)
File "/usr/local/lib/python2.7/dist-packages/pyafipws/wsfev1.py", line 111, in __analizar_errores
self.Eventos = ['%s: %s' % (evt['code'], evt['msg']) for evt in events]
ValueError: "code" while evaluating
u'action_number()'
A varios les paso y si no me equivoco es por la alerta del cambio de certificado. La actualización del certificado ya la hice y la tenia funcionando bien.
Pero ahora de repente, sin tocar nada me aparece el error.
Estoy intentando sin exito actualizar el pyafipws siguiendo los pasos que pusieron en otro temas.
Primero actualice odoo (supuestamente):
- sudo docker stop odoo80
- sudo docker rm -f odoo80
- git pull https://github.com/ingadhoc/odoo-addons
- git pull https://github.com/ingadhoc/odoo-argentina
- git pull https://github.com/aeroo/aeroo_reports
- Levante odoo de nuevo con -u -all
No termino de entender si con esto ya odoo queda todo actualizado incluido pyafipws.
Como tengo el error pase a actualizar pyafipws como indico otro usuario:
- docker exec -ti -u root odoo80 /bin/bash
- me abre en /pyafipws
- git init
- sudo git pull https://github.com/reingart/pyafipws.git (probe clone tambien)
- pip install -r requirements.txt (todo ok)
- python setup.py install
- acá me tira un error:
-
setup.py:76: UserWarning: Exception when converting the README format: [Errno 2] No such file or directory
warnings.warn("Exception when converting the README format: %s" % e)
running install
running build
running build_py
running install_lib
running install_data
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/PyAfipWs-2.7.1756.egg-info
Writing /usr/local/lib/python2.7/dist-packages/PyAfipWs-2.7.1756.egg-info - exit para salir
- sudo docker stop odoo80
- sudo docker rm -r odoo80
- Levante odoo de nuevo con -u -all
Pero no hay caso, sigo con el error.
Alguno tiene idea de que puedo estar haciendo mal?
Hola Sebastian. Si queres solucionar rapidamente el error para salir del paso y seguir facturando debes ingresar dentro del docker que contiene a odoo y una vez ahi dentro abrir el archivo 'wsfev1.py' ubicado en '/usr/local/lib/python2.7/dist-packages/pyafipws'. En ese archivo cambia la linea 111 por lo siguiente: self.Eventos = ['%s: %s' % (evt['Evt']['Code'], evt['Evt']['Msg']) for evt in events] Eso tendria que solucionar el error que te esta tirando. Saludos!
ok, muchas gracias.
Aviso por las dudas que hoy me empezó a tirar este mismo error nuevamente. No se si abran actualizado algo en AFIP. Tuve que actualizar pyafipws para se solucione.