Skip to content

Instantly share code, notes, and snippets.

@ovnicraft
Created August 7, 2020 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovnicraft/e784a4368d65efecd58524dba0e027c2 to your computer and use it in GitHub Desktop.
Save ovnicraft/e784a4368d65efecd58524dba0e027c2 to your computer and use it in GitHub Desktop.
@api.multi
def send_document(self, attachments=None, tmpl=False):
self.ensure_one()
ctxt = dict(self._context)
# clean context send email crash with context
tmpl = self.env.ref("xmild_template_mail")
tmpl.with_context(ctxt).send_mail( # noqa
self.id, email_values={"attachment_ids": attachments}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment