pdf = self.env['report'].sudo().get_pdf([invoice.id], 'account.report_invoice')
self.env['ir.attachment'].create({
'name': 'Cats',
'type': 'binary',
'datas': base64.encodestring(pdf),
'res_model': 'account.invoice',
'res_id': invoice.id
'mimetype': 'application/x-pdf'
})
In odoo10 we are using get_pdf method to get the data to create attachments so what is the equiavalent method in odoo 11 ?.