Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
4644 Widoki

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?

Awatar
Odrzuć
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 Najlepsza odpowiedź

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)


Awatar
Odrzuć

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

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 25
1451
2
gru 24
2431
0
lis 24
1238
0
sty 25
2646
1
paź 23
2790