跳至内容
菜单
此问题已终结
5 回复
10056 查看

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
3970
0
5月 20
1465
1
6月 25
4604
0
6月 25
314
0
1月 25
1418