1
votes

When you go to configuration->users in odoo as administrator, you see two groups under the category administration: Settings and Access rights. Since one of these groups are selected from a combo box, it seems to me like these groups are mutually exclusive, that is that a user can't be a member of both groups.

I need to do exactly the same with two groups under a custom category which I have created with the following data file:

<record id="FVO" model="ir.module.category">
    <field name="name"> FVO </field>
</record>
<record id="FVO_nuova" model="res.groups">
    <field name="name">FVO - nuova vista</field>
    <field name="category_id" ref="FVO"/>
</record>
<record id="FVO_vecchia" model="res.groups">
    <field name="name">FVO - vecchia vista</field>
    <field name="category_id" ref="FVO"/>
</record>

But in the users form, they appear as two check boxes, which means that the user could be member of both groups.

Now I've studied both of these groups, and it's category, inspecting also the tables in which they are stored, to try to find out which flag they have so that Settings and Access rights can't be applied to one user at the same time, but for the life of me, I can't find anything special nor in the record for the group, nor in the record for the category.

Is someone able to point out what I'm missing?

1

1 Answers

0
votes

I don't know the meaning of vecchia vista and nuova vista so i cannot understand if they are cascade or not, if they are cascade (inherited) rights (like 'see_own_leads' and 'see_all_leads'), you should use <field name="implied_ids" eval="[(4, ref('FVO_nuova'))]"/> in your FVO_vecchia group so odoo will understand the user should select one of your groups not both of them.

If your groups are not meant to be cascade, i should define 3 groups like this:

`

<record id="FVO_none" model="res.groups">
    <field name="name">FVO - no access</field>
    <field name="category_id" ref="FVO"/>
</record> 
<record id="FVO_nuova" model="res.groups">
    <field name="name">FVO - nuova vista</field>
    <field name="implied_ids" eval="[(4, ref('FVO_none'))]"/>
    <field name="category_id" ref="FVO"/>
</record>
<record id="FVO_vecchia" model="res.groups">
    <field name="name">FVO - vecchia vista</field>
    <field name="implied_ids" eval="[(4, ref('FVO_none'))]"/>
    <field name="category_id" ref="FVO"/>
</record>

`