跳至內容
選單
此問題已被標幟
3 回覆
4684 瀏覽次數

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?

頭像
捨棄
作者

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)

作者 最佳答案

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)


頭像
捨棄

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

最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 25
1490
2
12月 24
2460
0
11月 24
1383
0
1月 25
2681
1
10月 23
2812