تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
6274 أدوات العرض

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>
الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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>
الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب

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>

أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أكتوبر 20
5489
1
يونيو 18
6362
1
ديسمبر 16
3105
0
أكتوبر 19
5799
1
يوليو 19
598