How to enable a security group for all users?

I created a new group via XML for access rights management

        <record model="res.groups" id="group_no_open_procurement">
            <field name="name">Only Tree view for procurement</field>

I need to enable this group for all the users by code itself and not manually changing @ User window.  How should I proceed?


Add your new group to the inherited_ids of base.group_user.

Either in the web client, or in via your security xml file:

<record id="base.group_user" model="res.groups">
                 <field name="name">Employee</field>
                 <field name="users" eval="[(4, ref('base.user_root'))]"/>
                 <field name="implied_ids" eval="[(4, ref('group_no_open_procurement'))]"></field>

This might be easier and adds your group to all existing users aswell (not just new ones), but I think prakashs suggestion is the cleaner way.



Need more info?

This documentation page has been extracted from the Q&A section where you can discuss it and get feedback.
Related question