Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5602 มุมมอง

Hi,

How can i add attachments using message_post method in Odoo 13.

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Try the following code

attachment_ids = fields.Many2many('ir.attachment', 'doc_warning_rel', 'doc_id', 'attach_id4', string="Attachment")

def your_custom_function(self):
attachments = []
for i in self.attachment_ids:
attachments.append(i.id)
self.message_post(body='your message', partner_ids='your partner ids', attachment_ids=attachments)

Regards

อวตาร
ละทิ้ง