Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
4884 Zobrazení

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
Zrušit
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 Nejlepší odpověď

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
Zrušit

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

Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 25
1635
2
pro 24
2662
0
lis 24
3033
0
led 25
2819
1
říj 23
2957