Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
4660 Vues

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
Ignorer
Auteur

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)

Auteur Meilleure réponse

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
Ignorer

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

Meilleure réponse

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

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
févr. 25
1473
2
déc. 24
2445
0
nov. 24
1306
0
janv. 25
2668
1
oct. 23
2801