コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
10771 ビュー

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

関連投稿 返信 ビュー 活動
1
7月 25
277
0
10月 24
1105
1
10月 23
3602
2
8月 22
3594
1
5月 19
4390