Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
10805 Представления

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.


Аватар
Отменить
Автор Лучший ответ

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
Аватар
Отменить

thanks brother

Related Posts Ответы Просмотры Активность
1
июл. 25
281
0
окт. 24
1107
1
окт. 23
3618
2
авг. 22
3603
1
мая 19
4414