Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
10758 Vues

Hi, I'm using odoo 11.

How to send a notification to the followers when a new activity is created?

I modified the subtype "activities" as default but that changed nothing.


Avatar
Ignorer
Auteur Meilleure réponse

Here's what I did for those who want to do the same thing:

class MailActivity(models.Model):

_inherit = ['mail.thread','mail.activity']
_name='mail.activity'

@api.model
def create(self, values):
rec = super(MailActivity, self).create(values)
model= self.env[rec.res_model].search([('id','=',rec.res_id)])
followers=model.message_partner_ids
follower_ids=(tuple(followers.ids))
rec.message_post(subject='New activity',type='email',partner_ids=follower_ids)
return rec
Avatar
Ignorer

thanks brother

Publications associées Réponses Vues Activité
1
juil. 25
273
0
oct. 24
1102
1
oct. 23
3594
2
août 22
3589
1
mai 19
4383