code_explorer
code_explorer

Reputation: 480

How to remove implied ids from group in odoo?

I am trying to remove implied ids of purchase user group. This is actual group in purchase order

<record id="group_purchase_manager" model="res.groups">
    <field name="name">Manager</field>
    <field name="category_id" ref="base.module_category_purchase_management"/>
    <field name="implied_ids" eval="[(4, ref('group_purchase_user'))]"/>
    <field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

Then I am trying to remove implied of the group in my custom module

<record id="purchase.group_purchase_manager" model="res.groups">
    <field name="name">Manager</field>
    <field name="category_id" ref="base.module_category_purchase_management"/>
    <field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

I also tries another

<record id="purchase.group_purchase_manager" model="res.groups">
    <field name="implied_ids" eval="False"/>
</record>

unfortunately both will not work.

I checked the groups of purchases/Manger in UI but the inherited group purchases/User still there.

How to remove implied ids from purchase manager group??

Upvotes: 4

Views: 1632

Answers (1)

Bhavesh Odedra
Bhavesh Odedra

Reputation: 11141

You may try with following code.

<record id="purchase.group_purchase_manager" model="res.groups">
    <field name="name">Manager</field>
    <field name="category_id" ref="base.module_category_purchase_management"/>
    <field name="implied_ids" eval="[(4, ref('purchase.group_purchase_user'))]"/>
    <field name="users" eval="[(3, ref('base.user_root'))]"/>
</record>

With help of 3, we will cut/delete relationship between two objects without delete target ID (ref('base.user_root')).

I haven't tested it.

Upvotes: 4

Related Questions