콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5620 화면

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

아바타
취소