< div class="oe_chatter">
< field name="message_follower_ids"/>
< field name="message_ids"/>
< /div>
This simple code show chatter information for all internal users. But I want to show it only for a group. How can I do this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
This is my solution:
You have to inherit the form view and specify the groups for which you want to hide chatter.
Example:
id="crm_lead_form_view_custom" model="ir.ui.view">
name="name">Form View for custom group
name="model">crm.lead
name="inherit_id" ref="crm.crm_lead_view_form"/>
name="groups_id" eval="[(6,0, (ref('module_name.custom_group'),))]"/>
name="arch" type="xml">
expr="//div[hasclass('oe_chatter')]" position="replace">
class="oe_chatter">
<record id="crm_lead_tree_view_button_salesman" model="ir.ui.view">
<field name="name">Form View for salesman</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
<field name="groups_id" eval="[(6,0, (ref('erp_plusinnovation.erp_salesman'),))]"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_chatter')]" position="replace">
<div class="oe_chatter">
</div>
</xpath>
</field>
</record>
Hi Abdus Sattar Bhuiyan,
Inherit the form and specify the group you want to show chatter
<record id="res_bank_oe_chatter" model="ir.ui.view">
<field name="name">res.bank.chatter<field/>
<field name="model">res.bank<field/>
<field name="inherit_id" ref="base.view_res_bank_form"/>
<field name="groups_id" eval="[(6, 0, [ref('your_module_name.your_group')])]"/> // Chatter will be visible only to this group
<field name="arch" type="xml">
<xpath expr="//sheet" position='after'>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
div>
xpath>
field>
record>
To Hide and make the chatter for an existing view,
// Remove Chatter For All Users
<record id="employee_oe_chatter_invisible" model="ir.ui.view">
<field name="name">hr.employee.chatterfield>
<field name="model">hr.employeefield>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_chatter')]" position="replace">
xpath>
field>
record>
// Visible To Custom Group
<record id="employee_oe_chatter_custom_group" model="ir.ui.view">
<field name="name">hr.employee.chatter.customfield>
<field name="model">hr.employeefield>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="groups_id" eval="[(6, 0, [ref('module_name.group')])]"/>
<field name="arch" type="xml">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
div>
field>
record>
Hope it Helps,
Kiran K
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
1940 | ||
|
1
Apr 24
|
264 | ||
|
2
Apr 23
|
2653 | ||
|
1
Sep 22
|
3052 | ||
|
0
Sep 22
|
1134 |