Make field readonly based on group
In Attendance section there is 'name' field used to display/edit date. I am having two user groups 'base.group_user' and 'base.group_hr_user'. I want to use inheritance and make this field readonly for 'base.group_user' group and other group 'base.group_hr_user' should work as it is.
Searched over this community and did some changes like that
<record id="odoo_hr_attendance_view_form" model="ir.ui.view">
<field name="inherit_id" ref="hr_attendance.view_attendance_form" />
<field name="groups_id" eval="[(6,0, [ref('base.group_user')])]" />
<field name="arch" type="xml">
<field name="name" position="attributes">
But now it's showing readonly for both the groups.
Can anyone please guide me how to achieve my results?