Skip to content

Commit

Permalink
Merge 810ccf0 into 5f6ce4f
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Aug 2, 2019
2 parents 5f6ce4f + 810ccf0 commit bd28f8a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions br_account_einvoice/models/invoice_eletronic.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,15 @@ def send_email_nfe(self):
atts = self._find_attachment_ids_email()
_logger.info('Sending e-mail for e-doc %s (number: %s)' % (
self.id, self.numero))
self.invoice_id.message_post_with_template(
mail.id, attachment_ids=[(6, 0, atts + mail.attachment_ids.ids)])

values = mail.generate_email([self.invoice_id.id])[self.invoice_id.id]
subject = values.pop('subject')
values.pop('body')
values.pop('attachment_ids')
self.invoice_id.message_post(
body=values['body_html'], subject=subject,
message_type='email', subtype='mt_comment',
attachment_ids=atts + mail.attachment_ids.ids, **values)

@api.multi
def send_email_nfe_queue(self):
Expand Down

0 comments on commit bd28f8a

Please sign in to comment.