Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
4755 Ansichten

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
Verwerfen
Autor

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)

Autor Beste Antwort

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
Verwerfen

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

Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Feb. 25
1541
2
Dez. 24
2524
0
Nov. 24
1671
0
Jan. 25
2699
1
Okt. 23
2871