Skip to Content
Menu
This question has been flagged
5 Replies
8734 Views

Hi,


I'm very new to Odoo development. Following with the example (https://books.google.ca/books?id=_fKBDwAAQBAJ&pg=PA119&lpg=PA119&dq=odoo+development+library.member&source=bl&ots=0sppGuWsVl&sig=ACfU3U3cQcwvQS8dfmxKTSEIeWx6MV_A-w&hl=en&sa=X&ved=2ahUKEwj54u2n8dnpAhUAj3IEHfKcDU8Q6AEwAHoECAoQAQ#v=onepage&q=odoo development library.member&f=false), I'm trying to create my first App. But after setting up security configuration, I can't access the Library menu from a portal register user(New register user from login page). However, Admin has no problem, I might be confused by Odoo's user group structure. not sure what is the correct way to grant access permission to a normal user. My security configuration is following:


ir.model.access.csv:

    id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

    access_book_user,BookUser,model_library_book,library_group_user,1,0,0,0

    access_book_manager,BookManager,model_library_book,library_group_manager,1,1,1,1


library_security.xml

    <record id="library_group_user" model="res.groups">

        <field name="name">User</field>

        <field name="category_id" ref="module_library_category" />

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

    </record>

    <record id="library_group_manager" model="res.groups">

        <field name="name">Manager</field>

        <field name="category_id" ref="module_library_category" />

        <field name="implied_ids" eval="[(4, ref('library_group_user'))]" />

        <field name="users" eval="[

                    (4, ref('base.user_root')),

                    (4, ref('base.user_admin'))

                ]" />

    </record>


I'm hoping the Library application could be open to all users by default. Be appreciated if anyone can explain with me the right approaching to the permission management. 


Thanks. 


Avatar
Discard

Check this groups and access rights in odoo: https://goo.gl/4jAhtH

I got the same problem, anyone has solution ?

Best Answer

Check the newly created user belongs to library_group_user group.

Avatar
Discard
Author

No, the user belongs to 'User types / Portal' and 'Technical Settings / Tax display B2B' by default.

Then Give Access Rights to Portal Users , id of portal is base.group_portal

"access_controll_list_id","title/name","model_your_model_name_goes_here","module_name.group_name_goes_here",1,1,1,1

access_book_portal,BookPortal, model_library_book,base.group_portal, 1,0,0,0

https://github.com/odoo/odoo/blob/12.0/addons/gamification/security/ir.model.access.csv

Author

I tried this approaching before, I changed the implied_dis to: <field name="implied_ids" eval="[(4, ref('base.group_portal'))]" />, but it encountered exception: "The user cannot have more than one user types".

If I changed it to "access_book_user,BookUser,model_library_book,base.group_portal,1,0,0,0" in ir.model.access.csv, the menu disappeared from all users, include Admin.

Related Posts Replies Views Activity
1
Aug 20
2918
0
May 20
827
0
Mar 20
3574
0
Dec 24
55
2
Oct 24
30