Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
5322 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 25
2036
Chatter looks weird in 18.0 แก้ไขแล้ว
2
ธ.ค. 24
3092
0
พ.ย. 24
6178
0
ม.ค. 25
3054
Change chatter size? แก้ไขแล้ว
1
ต.ค. 23
3246