Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16.0[IMP]document_page: menu_parent_id context domain of menu creation #448

Conversation

Tisho99
Copy link
Contributor

@Tisho99 Tisho99 commented Jan 9, 2024

On the document_page module, there is one use case when we can't correctly create a menu item for a page.

This case occurs when we want to create the document menu under a new "Documentation" menu. Example:

Sales
- Documentation
- Page 1
- Page 2
...

Steps to reproduce:

  1. Create the "Documentation" parent menu, as it is a folder we dont fill the 'action' field.
  2. Go to a knowledge document form, and select action -> create mene. You can see that the "Documentation" menu does not appear on the parent menu's list.

Captura de pantalla de 2024-01-09 13-59-25

The reason of the problem is that, by default, we only can see the menus that have an action, or a child with actions.
To see all, odoo gives a context parameter that can be placed on the field: context="{'ir.ui.menu.full_list': True}".
However, with this context on the menu_parent_id of the document_page create menu wizard the document users are able to see menus they must not be able to see due to permission groups; and they can create aditional menus under the unauthorized ones.
To solve this, a new context parameter has been created: "ir.ui.menu.authorized_list", that allows to see all menus, except the unauthorized by permission groups

PD: A unit test is in progress

@Tisho99
Copy link
Contributor Author

Tisho99 commented Jan 9, 2024

@ValentinVinagre

@ValentinVinagre
Copy link

ValentinVinagre commented Jan 9, 2024

@HaraldPanten @etobella 😄

@Tisho99 Tisho99 marked this pull request as draft January 9, 2024 15:22
@Tisho99
Copy link
Contributor Author

Tisho99 commented Jan 9, 2024

@etobella

I will put this PR in draft for some time because i am developing a unit test

Thank you for your review!

@Tisho99 Tisho99 force-pushed the 16.0-imp-document_page_menu_create-menu_parent_id branch from 1e1ddf1 to ab335a1 Compare January 10, 2024 12:51
@Tisho99 Tisho99 force-pushed the 16.0-imp-document_page_menu_create-menu_parent_id branch from ab335a1 to 1897d3b Compare January 10, 2024 12:54
@Tisho99 Tisho99 marked this pull request as ready for review January 10, 2024 12:58
Copy link

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@etobella
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-448-by-etobella-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b572002 into OCA:16.0 Jan 10, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 954d7b2. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants