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

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.



Ảnh đại diện
Huỷ bỏ

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.

Câu trả lời hay nhất

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



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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 4 17
15896
0
thg 6 24
1091
1
thg 1 22
6227
1
thg 8 25
3966
1
thg 2 25
1965