Hello!
I want to show these messages but their body is empty so in the chatter appears nothing.
I mean, model 'mail.message' with message_type = 'notification'.
How can i do it?
Thanks!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello!
I want to show these messages but their body is empty so in the chatter appears nothing.
I mean, model 'mail.message' with message_type = 'notification'.
How can i do it?
Thanks!
def send_notification(self, message):you can do something like this here i'm getting all target users through a specific group and append notifications to them the notification will be shown in each user chat notification drop down list and also at the Discuss Home page
target_user_group = self.env.ref('module.group_name')
target_users = self.env['res.users'].search(
[('groups_id', '=', target_user_group.id)]
)
notification_ids = []
for user in target_users:
notification_ids.append((0, 0, {
'res_partner_id': user.partner_id.id,
'notification_type': 'inbox'}))
self.message_post(body=message, message_type='notification', subtype='mail.mt_comment',
notification_ids=notification_ids)
Hope it helped
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se| Related Posts | Respostes | Vistes | Activitat | |
|---|---|---|---|---|
|
1
de juny 19
|
9713 | |||
|
1
de febr. 25
|
2417 | |||
|
Chatter looks weird in 18.0
Solved
|
2
de des. 24
|
3546 | ||
|
0
de nov. 24
|
7710 | |||
|
|
3
d’oct. 25
|
5809 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.