Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3 Besvarelser
4818 Visninger

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
Kassér
Forfatter

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)

Forfatter Bedste svar

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
Kassér

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

Bedste svar

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

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
feb. 25
1599
2
dec. 24
2586
0
nov. 24
2224
0
jan. 25
2764
1
okt. 23
2902