I have an encoded string (excel_file) and I want to generate a xsl file from this string.
Is it possible to generate a .xsl file adding a code only in my .py file without saving this file in local, because I want to attache this file to a mail.
att_id = self.env['ir.attachment'].create({
'name': 'My name',
'type': 'binary',
'datas':excel_file,
'datas_fname': 'Myname.xsl',
'res_model': 'print.invoice.cron',
'res_id': self.id,
'mimetype': 'text/csv'
})
tools.email_send(email_from='sending@test.fr',
email_to=['recive@gmail.com'],
subject='Some subject',
body=att_id)
I'm reciving the id of attachement,but not the file.And there is no attache attribute for email_send()