콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
5850 화면
< 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?


아바타
취소
베스트 답변

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


아바타
취소
관련 게시물 답글 화면 활동
1
5월 25
4671
2
11월 24
4145
1
4월 24
1379
1
9월 22
4496
0
9월 22
2288