i everyone,
I would like to add a message on the chat every time that someone use the "Generate PDF" button.
With the message I would like to have a message like "PDF Attached" and the PDF on attachment, like in this picture:
I create the PDF on ir.attachments, and im trying to use message_post() method in order to add the ID of the created attachment, but it does not work.
def add_chat_message(self, body_msg):
#Test with the created attachment
attachment = self.env['ir.attachment'].browse(4749)
self.message_post(body=body_msg, attachments=attachment)
How should I use this method on Odoo11?
Thank a lot you for your help.