I need to override an existing group in a custom module and change just it's implied_ids
field in another custom module. I tried to use the same code in my module with the changes in implied_ids
but I had bellow error. Then I tried to use inherit_id field but is raised duplicate id error again. Bellow is the original group in a custom module:
<record id="group_hms_jr_doctor" model="res.groups">
<field name="name">Jr Doctor</field>
<field name="category_id" ref="module_category_hms"/>
<field name="implied_ids" eval="[(4, ref('acs_hms.group_hms_nurse')),(4, ref('acs_hms.group_hms_receptionist'))]"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
and I want to just remove (4, ref('acs_hms.group_hms_receptionist'))
section from it. I tried bellow code, but this errors raises.
odoo.tools.convert.ParseError: "duplicate key value violates unique constraint "res_groups_name_uniq"
DETAIL: Key (category_id, name)=(68, Jr Doctor) already exists.
" while parsing /home/ibrahim/workspace/odoo/hms/nl_hms/security/security.xml:5, near
<record id="group_hms_jr_doctor_inherited" model="res.groups">
<field name="name">Jr Doctor</field>
<field name="inherit_id" ref="acs_hms.group_hms_jr_doctor"/>
<field name="category_id" ref="acs_hms.module_category_hms"/>
<field name="implied_ids" eval="[(4, ref('acs_hms.group_hms_nurse'))]"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
How can I override any existing groups and changes it?