We have a model with a chatter and creating records.
For all (by code) newly created records the current user is automatically set as following to the record.
How to avoid this automatic subscription behavior in Odoo14/15?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
We have a model with a chatter and creating records.
For all (by code) newly created records the current user is automatically set as following to the record.
How to avoid this automatic subscription behavior in Odoo14/15?
I added message_is_follower in create method:
self.env['mymodel'].create({
'message_is_follower': False,
....
Which was not working...
-------------------------------------
SOLUTION:
This code prevents automatic follow assignment of the current user during creating new database records.
self.env['mymodel'].with_context(mail_create_nosubscribe=True).create(vals)
Could you post a bit more of the script you tried?
When you set the properties of the record set 'message_is_follower': False
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
فبراير 25
|
1507 | ||
Chatter looks weird in 18.0
تم الحل
|
|
2
ديسمبر 24
|
2482 | |
|
0
نوفمبر 24
|
1502 | ||
|
0
يناير 25
|
2690 | ||
Change chatter size?
تم الحل
|
|
1
أكتوبر 23
|
2828 |
During the meanwhile I figured out a solution.
When the model is being created an additional context can be used like this:
self.env['mymodel'].with_context(mail_create_nosubscribe=True).create(vals)