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

so i already looked over this thread: 

https://stackoverflow.com/questions/63557264/odoo-13-how-to-use-message-post-to-send-message-in-the-chatter/76754252?noredirect=1#comment135317243_76754252

but i am still lost on how i should proceed with creating the event, i am fairly new to odoo so i would appreciate any help.

I tried adding a new button in the composer tool bar, that worked as expected however said button can't use the message_post() method of the channel model cause it counts under the composer model.

Edit: sorry about the mix-up i meant to say i need to add an additional button in the discuss tab where while talking with someone in a chat or a channel i can ping them to give them with a predetermined message in the code.

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

Hi 

You can update the code as follows 

users = self.user_ids
message_body = _("The user %s is added.", self.name)
self.message_post(partner_ids=users.mapped('partner_id').ids, body=message_body)

https://www.cybrosys.com/blog/how-to-post-a-message-to-chatter-in-odoo-16#:~:text=In%20Odoo%2C%20these%20messages%20are,message%20in%20a%20record's%20chatter.&text=In%20the%20message_post%20method%2C%20content%20is%20passed%20inside%20the%20parameter%20body.

https://youtu.be/W4nGOGpZpVc?si=ZMST2WLRaT-cPjtp


Regards

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

Hi,

In Odoo, these messages are posted on the chat using a message_post () function, which is used to create a new message or reply to an existing message in a record's chatter.Here in this blog, we will detail how to post a message to chatter 

Please refer: https://www.cybrosys.com/blog/how-to-post-a-message-to-chatter-in-odoo-16


Hope it helps.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 23
2007
1
ก.ค. 23
2120
0
พ.ค. 23
2165
2
ส.ค. 25
2106
1
ก.ค. 25
676