Skip to content

Commit

Permalink
[FIX] l10n_br_nfe: qr code generation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
felipezago authored and lfdivino committed Oct 4, 2023
1 parent 28c89ea commit 177b4e5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions l10n_br_nfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,19 @@ def _generate_key(self):
)
record.document_key = chave_edoc.chave

def _document_qrcode(self):
super()._document_qrcode()

for record in self.filtered(filter_processador_edoc_nfe):
record.nfe40_infNFeSupl = self.env[
"l10n_br_fiscal.document.supplement"
].create(
{
"qrcode": record.get_nfce_qrcode(),
"url_key": record.get_nfce_qrcode_url(),
}
)

def _eletronic_document_send(self):
self._prepare_payments_for_nfce()

Expand All @@ -982,16 +995,6 @@ def _eletronic_document_send(self):
if record.xml_error_message:
return

if record.document_type == MODELO_FISCAL_NFCE:
record.nfe40_infNFeSupl = self.env[
"l10n_br_fiscal.document.supplement"
].create(
{
"qrcode": self.get_nfce_qrcode(),
"url_key": self.get_nfce_qrcode_url(),
}
)

processador = record._processador()
for edoc in record.serialize():
processo = None
Expand Down

0 comments on commit 177b4e5

Please sign in to comment.