Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4901 Lượt xem

Disclaimer: I am very new to Odoo. So I maybe missing something ob

Note: I am running Odoo 13. 

I am trying to disable chatter for certain user groups.

Currently the XML file contains this code:-

<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" groups="generic_request.group_ims_moderator"/>
<field name="activity_ids" widget="mail_activity" groups="generic_request.group_ims_moderator"/>
<field name="message_ids" widget="mail_thread" groups="generic_request.group_ims_moderator"/>
</div>


As you can see, I only want the chatter to be visible to 'group_ims_moderator'. But it's like the groups attribute has no effect. I am able to see the chatter on all user groups, including basic users. Is there anything else I need to modify in other files in order to get this to work.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

this is a web client bug :(.  it doesn't check view definition/arch modifiers while rendering chatter fields.
Server is sending correct modifiers but web client only depends on fields definition defined in python.

so make it work redefine fields in your model and add groups like
​message_ids = fields.One2many(groups="generic_request.group_ims_moderator")

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you! This worked.

Awesome :)

Hi Ravi - has this been reported on GitHub?

I haven't reported or checked it on GitHub.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 23
2786
3
thg 12 20
9875
1
thg 3 25
2529
2
thg 5 24
2058
1
thg 2 24
2505