Browse Source

Update __init__.py

A biblioteca ZEEP remove namespaces duplicadas. O estado do PR exige a mesma namespace em duas tags, devemos adicionar a mesma na tag NFe antes do envio ao sefaz Paraná.
pull/168/head
Felipe Lopes 7 years ago
committed by GitHub
parent
commit
b3457cb4af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pytrustnfe/nfe/__init__.py

6
pytrustnfe/nfe/__init__.py

@ -134,6 +134,12 @@ def _send(certificado, method, **kwargs):
port = next(iter(client.wsdl.port_types)) port = next(iter(client.wsdl.port_types))
first_operation = next(iter(client.wsdl.port_types[port].operations)) first_operation = next(iter(client.wsdl.port_types[port].operations))
if kwargs['estado'] == '41':
namespaceNFe = xml.find(".//{http://www.portalfiscal.inf.br/nfe}NFe")
if namespaceNFe is not None:
namespaceNFe.set('xmlns', 'http://www.portalfiscal.inf.br/nfe')
with client.settings(raw_response=True): with client.settings(raw_response=True):
response = client.service[first_operation](xml) response = client.service[first_operation](xml)
response, obj = sanitize_response(response.text) response, obj = sanitize_response(response.text)

Loading…
Cancel
Save