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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
يوليو 25
|
277 | ||
|
0
أكتوبر 24
|
1105 | ||
|
1
أكتوبر 23
|
3603 | ||
|
2
أغسطس 22
|
3595 | ||
|
1
مايو 19
|
4390 |