Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
4665 Visualizzazioni

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
Abbandona
Autore

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)

Autore Risposta migliore

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
Abbandona

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

Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
feb 25
1475
2
dic 24
2445
0
nov 24
1320
0
gen 25
2670
1
ott 23
2802