Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
9844 Переглядів

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
1916
1
лип. 23
2059
0
трав. 23
2087
1
лип. 25
395
1
черв. 25
1031