跳至內容
選單
此問題已被標幟
1 回覆
109 瀏覽次數

I created a group and added the access right ir_ui_menu with full permissions (read, write, create, delete) to it, expecting to see the hamburger menu when logging in with a user in this group. The ir_ui_menu access right works for the Internal group (group_user), but the hamburger menu doesn't appear for the user in my new group. What could be the issue, and how can I fix it? Please keep the answer simple and clear.


To address the issue where the hamburger menu wasn’t showing for my custom group user in Odoo 17, despite adding the ir_ui_menu access right, here’s exactly what I did step-by-step to try to make the hamburger menu accessible, mimicking the Internal User group’s behavior:

  1. Created a Custom Group:
    • Went to Settings > Technical > User Interface > Groups in Odoo 17 (with Developer Mode enabled).
    • Created a new group named "Custom Group" and set its Application to "User types" to align with groups like Internal User.
    • Saved the group and noted its ID (e.g., base.group_custom_123).
  2. Added Full Access to ir_ui_menu:
    • Navigated to Settings > Technical > Security > Access Controls List.
    • Created a new access rule:
      • Name: access_ir_ui_menu_custom
      • Model: Menu (ir.ui.menu)
      • Group: Selected "Custom Group"
      • Permissions: Enabled all (Read, Write, Create, Delete) to give full access (1,1,1,1), similar to the Internal User group (base.group_user).
    • Saved and verified the rule was listed for ir.ui.menu.
  3. Added Read Access to res.users:
    • Noticed a 403: Forbidden error saying the user couldn’t access res.users, which seemed needed for the hamburger menu.
    • Went back to Settings > Technical > Security > Access Controls List.
    • Created another access rule:
      • Name: access_res_users_custom
      • Model: User (res.users)
      • Group: Selected "Custom Group"
      • Permissions: Enabled only Read (1,0,0,0) to allow reading user data without changes.
    • Saved and confirmed the rule was applied.
  4. Created a Test User with Only the Custom Group:
    • Went to Settings > Users & Companies > Users.
    • Created a new user:
      • Name: "Test User"
      • Email/Login: testuser@example.com (unique login)
      • Access Rights: In the Access Rights tab, unchecked all other groups (e.g., Internal User, Portal) and checked only "Custom Group".
    • Saved and verified the user had only the custom group assigned.
  5. Tested Login:
    • Logged out and logged in as the test user (testuser@example.com).
    • Checked if the hamburger menu appeared in the top-left corner.
  6. Cleared Cache:
    • Cleared the browser cache (Ctrl+Shift+Delete in Chrome, selected "Cached images and files").
    • Cleared server cache by deleting .pyc files: 
      find /path/to/odoo -name "*.pyc" -delete
    • Restarted the Odoo server: 
      sudo systemctl restart odoo
  7. Checked Record Rules for res.users:
    • Suspected a Record Rule was blocking res.users access.
    • Went to Settings > Technical > Security > Record Rules.
    • Searched for rules on the User model (res.users).
    • Found a rule restricting access to groups like Internal User, Portal, etc., but my custom group wasn’t included.
    • Added my custom group to the rule’s Groups field to allow access.
    • Saved the rule and retested login.

Despite these steps, the hamburger menu still didn’t appear for the test user in the custom group, even though the Internal User group shows it fine with similar ir_ui_menu access.

頭像
捨棄

What exactly did you do?

I wonder, what hamburger menu are you actually talking about..?

作者

class="o-dropdown dropdown o_navbar_apps_menu o-dropdown--no-caret"

最佳答案

Ok, so we're probably talking about community. 

I however still don't get what you even try to achieve. By now you have a new user type that doesn't inherit anything and has access the model ir.ui.menu and res.users only. ir.ui.menu is where menu records are stored - this has nothing to do with the access to the actual modules/models/views/actions displayed within that menu.


You should give, for example

- https://www.odoo.com/documentation/17.0/applications/general/users/access_rights.html

- https://www.odoo.com/documentation/17.0/developer/tutorials/restrict_data_access.html

- https://www.odoo.com/documentation/17.0/developer/reference/backend/security.html#reference-security-acl

- https://www.odoo.com/slides/slide/group-access-rights-10139

a good read/listen

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
1月 25
417
1
12月 24
653
2
4月 25
247
1
2月 25
391
3
2月 25
595