Skip to content

Commit

Permalink
[REF] action_download_all_xmls refatorado para novos modelos
Browse files Browse the repository at this point in the history
  • Loading branch information
hugouchoasborges authored and Hugo Borges committed Mar 13, 2020
1 parent 22cb951 commit 364048c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions l10n_br_fiscal/models/mdfe/mdfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,23 @@ def action_download_all_xmls(self):
if self.state == SIT_MANIF_PENDENTE[0]:
self.action_ciencia_emissao()

return self.download_attachment(self.action_download_xml())
attachment_id = self.action_download_xml()
# TODO: Message post de Download concluído no formulário do MDF-e
# TODO: Exibir conversação na MDF-e
return self.download_attachment(attachment_id)

attachments = []

for record in self:
# TODO: Message post de Download concluído no formulário do MDF-e
# TODO: Exibir conversação na MDF-e
attachment = record.action_download_xml()
attachments.append(attachment)

monta_anexo = self.env["l10n_br_fiscal.attachment"].create([])
built_attachment = self.env["l10n_br_fiscal.attachment"].create([])

attachment_id = monta_anexo.build_compressed_attachment(attachments)
attachment_id = built_attachment.\
build_compressed_attachment(attachments)

return self.download_attachment(attachment_id)

Expand Down

0 comments on commit 364048c

Please sign in to comment.