In hr attendances, there is a datetime field called "name".
I want to set this field editable only for a group (or set readonly for other groups).
For example, I want to set the field "name" editable in the "tree" view for the "manager" group.
I have extended the attendance module and I have this code in the XML of my extended module:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_attendance_tree" model="ir.ui.view">
<field name="name">hr.attendance.tree</field>
<field name="model">hr.attendance</field>
<field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
<field name="groups_id" eval="[(6,0,[ref('base.group_hr_manager')])]" />
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="readonly">0</attribute>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
That is wrong, but more or less that's the idea.
I have tried this too:
<record id="hr_attendance.name" model="ir.ui.view">
<field name="groups_id" eval="[(3,ref('base.group_hr_user'))]"/>
</record>
It doesn't work either
What I have to modify in order to achieve this?
Note: I checked another similar post (https://www.odoo.com/es_ES/forum/ayuda-1/question/how-to-set-a-field-readonly-for-a-employee-group-85423) but it doesn't worked for me.
First get login user group: https://goo.gl/Ts3qqK
Second make a boolean field and on the basis of that field make field visible/invisible/readonly etc: https://goo.gl/BCxCpk