コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
10109 ビュー

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. 


アバター
破棄

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

I got the same problem, anyone has solution ?

最善の回答

Check the newly created user belongs to library_group_user group.

アバター
破棄
著作者

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

著作者

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.

関連投稿 返信 ビュー 活動
1
8月 20
4017
0
5月 20
1514
1
6月 25
4673
0
6月 25
354
0
1月 25
1456