Skip to Content
मेन्यू
This question has been flagged
3 Replies
4847 Views

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?

Avatar
Discard
Author

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)

Author Best Answer

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)


Avatar
Discard

Could you post a bit more of the script you tried?

Best Answer

When you set the properties of the record set 'message_is_follower': False

Avatar
Discard
Related Posts Replies Views Activity
1
फ़र॰ 25
1614
2
दिस॰ 24
2608
0
नव॰ 24
2685
0
जन॰ 25
2788
1
अक्तू॰ 23
2934