danimaribeiro / PyTrustNFe

Módulo NF-e Python
GNU Affero General Public License v3.0
174 stars 140 forks source link

Erro durante emissão NFC-e MS #260

Open egondadalt opened 4 years ago

egondadalt commented 4 years ago

Boa tarde. Estou tentando emitir nfce utilizando a pytrustnfe, porém, é apresentado o erro abaixo:


2020-01-10 18:28:38,008 1568 INFO mibis odoo.addons.base.models.ir_cron: Starting job `Cron Enviar NFe`.
2020-01-10 18:28:38,018 1568 INFO mibis odoo.addons.base.models.ir_cron: Job `Cron Enviar NFe` done.
2020-01-10 18:28:59,246 1568 INFO mibis odoo.addons.br_nfe.models.invoice_eletronic: Sending NF-e (2) (100.00) - Egon Leon Dadalt
2020-01-10 18:29:00,219 1568 WARNING mibis py.warnings: /usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

2020-01-10 18:29:00,433 1568 ERROR mibis odoo.http: Exception during JSON request handling.

Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/odoo/odoo-server/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo-server/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo-server/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/custom/addons/odoo-brasil/br_nfe/models/invoice_eletronic.py", line 947, in action_send_eletronic_invoice
    modelo=self.model)
  File "/usr/local/lib/python3.6/dist-packages/pytrustnfe/nfe/__init__.py", line 128, in autorizar_nfe
    return _send(certificado, 'NfeAutorizacao', **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/pytrustnfe/nfe/__init__.py", line 97, in _send
    first_op, client = _get_client(base_url, transport)
  File "/usr/local/lib/python3.6/dist-packages/pytrustnfe/nfe/__init__.py", line 82, in _get_client
    port = next(iter(client.wsdl.port_types))
StopIteration

Percebi que o erro é na linha 82

File "/usr/local/lib/python3.6/dist-packages/pytrustnfe/nfe/__init__.py", line 82, in _get_client
    port = next(iter(client.wsdl.port_types))

Sabe o que pode ser? Ou se tem uma forma do oddo exibir mais detalhado o erro:?

egondadalt commented 4 years ago

Esqueci de informar que o estado é MS;

egondadalt commented 4 years ago

image