콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5 답글
10435 화면

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
4261
0
5월 20
1685
1
6월 25
4984
5
9월 25
13885
0
6월 25
624