Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
4461 Vizualizări

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?

Imagine profil
Abandonează
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 Cel mai bun răspuns

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)


Imagine profil
Abandonează

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
feb. 25
1338
2
dec. 24
2282
0
nov. 24
1109
0
ian. 25
2564
1
oct. 23
2695