is there a way to print and get invoice report in the chatter without download it
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
Hi,
Check My answer here.
https://www.odoo.com/forum/help-1/add-an-attachment-pdf-to-message-post-chat-174727
Regards,
Silvestar
Hi it's solved
so to do it there is a function that call the pdf report without download it
render_qweb_pdf()
and i have do it like this :
import base64
pdf = self.env.ref('account.YOUR REPORT NAME HERE').sudo().render_pdf(self.id)[0]
pdf = base64.b64encode(pdf)
#here to get the attachement bewlo your invoice instead of the chatter
self.env['.ir.attachment'].create({'name':self.number or self.name,
'name': num,
'type': 'binary',
'datas': base64.encodestring(pdf),
'res_model': 'account.invoice',
'res_id': self.id,
'mimetype': 'application/x-pdf',
})
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se