Skip to content

Commit

Permalink
[FIX] edoc.py: add namespace on NFE tag (Paraná)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Jan 24, 2023
1 parent 9adf8b3 commit 5b5c718
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/erpbrasil/edoc/edoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def _generateds_to_string_etree(self, ds, pretty_print=False):
return contents, etree.fromstring(contents)

def _post(self, raiz, url, operacao, classe):

# Estado do Paraná é obrigatório que o namespace seja definido tbm na tag NFE
if operacao == 'nfeAutorizacaoLote':
namespaceNFe = raiz.find(".//{http://www.portalfiscal.inf.br/nfe}NFe")
if namespaceNFe is not None:
namespaceNFe.set('xmlns', 'http://www.portalfiscal.inf.br/nfe')

xml_string, xml_etree = self._generateds_to_string_etree(raiz)
with self._transmissao.cliente(url):
retorno = self._transmissao.enviar(
Expand Down

0 comments on commit 5b5c718

Please sign in to comment.