< 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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 5 25
|
4508 | ||
|
2
thg 11 24
|
3973 | ||
|
1
thg 4 24
|
1301 | ||
|
1
thg 9 22
|
4394 | ||
|
0
thg 9 22
|
2099 |