Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
10830 Visninger

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
Kassér
Forfatter Bedste svar

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
Kassér

thanks brother

Related Posts Besvarelser Visninger Aktivitet
1
jul. 25
297
0
okt. 24
1113
1
okt. 23
3634
2
aug. 22
3614
1
maj 19
4436