Skip to Content
Menu
This question has been flagged
4 Replies
4891 Views

I created a form and entered groups and access rules correctly, but I would like to know how to set a default rule for all new users. Now when I create a user, no rules are applied to him and consequently he has no read access to the model

My security xml:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record model="ir.module.category" id="myaddon_groups">
        <field name="name">My Addon</field>
        <field name="description">User access level for My addon</field>
        <field name="sequence">20</field>
    </record>
    <record id="myaddon_user" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="myaddond_groups"/>
    </record>
    <record id="myaddon_editor" model="res.groups">
        <field name="name">Editor</field>
        <field name="category_id" ref="myaddon_groups"/>
        <field name="implied_ids" eval="[(4, ref('myaddon_user'))]"/>
    </record>
    <record id="myaddon_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="myaddond_groups"/>
        <field name="implied_ids" eval="[(4, ref('myaddon_user'))]"/>
    </record>
    <record id="base.default_user" model="res.users">
        <field name="groups_id" eval="[(4, ref('myaddon_manager'))]"/>
    </record>
    <record id="base.group_system" model="res.groups">
        <field name="implied_ids" eval="[(4, ref('myaddon.myaddon_manager'))]"/>
    </record>
Avatar
Discard
Author Best Answer

Fixed by myself

<record id="base.group_system" model="res.groups">
        <field name="implied_ids" eval="[(4, ref('myaddon.myaddon_user'))]"/>
    </record>
    <record id="base.default_user" model="res.users">
        <field name="groups_id" eval="[(4, ref('myaddon_user'))]"/>
    </record>
Avatar
Discard
Best Answer

not work for me :/ i dont know why !!!

Avatar
Discard
Best Answer

Hi,

If you are looking how to set default access rights for a newly creating users in the system, you can configure the access rights for the Default User template, see this: https://www.youtube.com/watch?v=JeBRg_iXQHY




Thanks

Avatar
Discard
Author

Thanks, but only code, python, xml i tried

<record id="base.default_user" model="res.users">

<field name="groups_id" eval="[(4,ref('myaddos.group_user'))]"/>

</record>

Best Answer

Kindly check this article for better explanation: https://www.odoo.com/documentation/user/13.0/general/odoo_basics/add_user.html#access-rights-in-detail

Avatar
Discard
Related Posts Replies Views Activity
2
Oct 20
4297
1
Jun 18
5612
1
Dec 16
2373
0
Oct 19
4817
1
Jul 19
598