コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
7695 ビュー

Hi

I'd like to make notes on employees, that should not be visible by all employees, just be the manager and the employee himself.

I tried to extend the view, but the attributes seem not to work on the oe_chatter nore on message_ids.


This is the hr.employee.form

<div class="oe_chatter">          
    <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>   
    <field name="message_ids" widget="mail_thread" invisible="True"/>  
</div>

This is the extended view

<data>  
    <xpath expr="//field[@name='message_ids']" position="attributes">   
        <attribute name="attrs">{}</attribute>   
        <attribute name="groups">hr.group_hr_manager</attribute> 
    </xpath>
</data>

 

Still the oe_chatter is visible to all employees.

Any help is appreciated.



アバター
破棄

Look into Display multiple form and tree view for same model: http://learnopenerp.blogspot.com/2017/12/display-multiple-form-and-tree-view-for.html

hope this will helps you.

最善の回答

Hi,

try to create 2 different form views: one with chatter, another without.

For the form without chatter do not locate chatter or replace it. For the form with chatter assign groups:

        <record id="view_employee_form_with_chatter" model="ir.ui.view">
            <field name="name">hr.employee.form</field>
            <field name="model">hr.employee</field>
            <field name="group_ids" eval="[(4,ref('hr.group_hr_manager'))]"/>
            <field name="inherit_id" ref="hr.view_employee_form"/>
            <field name="arch" type="xml">
            ... <-- Place a chatter after sheet -->    


For the example look at the module hr_timesheet, the view hr_department_view_kanban.

Groups and visibility in chatter do not work. Another option is to change the js widget



アバター
破棄
著作者 最善の回答

Thank you very much Serish and Odoo Tools. Your tip helps me a lot. Now I understand how to achieve it.

アバター
破棄
関連投稿 返信 ビュー 活動
2
4月 17
15885
0
6月 24
1088
1
1月 22
6225
1
8月 25
3949
1
2月 25
1949