Browse Source

[FIX] Ajusta os namespaces para envio de NFe no estado do PR

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/175/head
Felipe Lopes 7 years ago
committed by Danimar Ribeiro
parent
commit
b3086c51f1
  1. 5
      pytrustnfe/nfe/__init__.py
  2. 2
      setup.py

5
pytrustnfe/nfe/__init__.py

@ -134,6 +134,11 @@ def _send(certificado, method, **kwargs):
port = next(iter(client.wsdl.port_types))
first_operation = next(iter(client.wsdl.port_types[port].operations))
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):
response = client.service[first_operation](xml)
response, obj = sanitize_response(response.text)

2
setup.py

@ -1,7 +1,7 @@
# coding=utf-8
from setuptools import setup, find_packages
VERSION = "1.0.0"
VERSION = "1.0.1"
setup(

Loading…
Cancel
Save