Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
10820 Lượt xem

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.


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ

thanks brother

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
287
0
thg 10 24
1107
1
thg 10 23
3622
2
thg 8 22
3606
1
thg 5 19
4417