fix(spp_dms): fix DMS app visibility and hide deprecated group from UI#176
fix(spp_dms): fix DMS app visibility and hide deprecated group from UI#176anthonymarkQA wants to merge 1 commit into19.0from
Conversation
The DMS app was not appearing on the home screen for users assigned Viewer, Officer, or Manager roles because the main menu was gated on (deprecated). The current role hierarchy only flows downward (group_dms_user → group_dms_officer → group_dms_viewer), so none of the active roles implied the deprecated group, making the app invisible to all non-admin users. Changes: - main_view.xml: change menu group gate from to so any assigned DMS role grants access to the app - security.xml: remove from so it no longer appears in the privilege selector in Settings; the record is kept for backwards compatibility with existing data
There was a problem hiding this comment.
Code Review
This pull request updates the DMS module by removing the privilege association from the deprecated user group and transitioning the main menu access to the viewer group. Feedback suggests explicitly setting the privilege field to False in the XML to ensure database consistency during upgrades and adding the configuration admin group to the main menu to prevent visibility issues for users with that role.
| <record id="group_dms_user" model="res.groups"> | ||
| <field name="name">User (Deprecated)</field> | ||
| <field name="privilege_id" ref="privilege_dms" /> | ||
| <field |
There was a problem hiding this comment.
To ensure that the privilege_id is actually cleared from existing records in the database during a module upgrade, simply removing the line from the XML is often insufficient in Odoo. In many cases, Odoo retains the existing value in the database if the field is omitted from the record definition during an update. It is recommended to explicitly set the field to False to guarantee it is hidden from the privilege selector as intended.
| <field | |
| <field name="privilege_id" eval="False" /> | |
| <field |
| name="DMS" | ||
| web_icon="spp_dms,static/description/OpenSPP-Icons-DMS.png" | ||
| groups="spp_dms.group_dms_user" | ||
| groups="spp_dms.group_dms_viewer" |
There was a problem hiding this comment.
The PR aims to ensure that any assigned DMS role grants access to the application. However, the group_dms_config_admin group (which corresponds to the "Config Access" role in the privilege selector) is not included in this menu's groups attribute and does not inherit from group_dms_viewer. Consequently, users assigned only the "Config Access" role will be unable to see the DMS app on the home screen. You should include this group to ensure all functional DMS roles have visibility of the root menu.
| groups="spp_dms.group_dms_viewer" | |
| groups="spp_dms.group_dms_viewer,spp_dms.group_dms_config_admin" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #176 +/- ##
==========================================
+ Coverage 71.48% 71.85% +0.37%
==========================================
Files 932 945 +13
Lines 54840 55975 +1135
==========================================
+ Hits 39201 40220 +1019
- Misses 15639 15755 +116
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
The DMS app was not appearing on the home screen for users assigned Viewer, Officer, or Manager roles because the main menu was gated on
(deprecated). The current role hierarchy only flows
downward (group_dms_user → group_dms_officer → group_dms_viewer), so none of the active roles implied the deprecated group, making the app invisible to all non-admin users.
Changes:
group_dms_usertogroup_dms_viewerso any assigned DMS role grants access to the appprivilege_idfromgroup_dms_userso it nolonger appears in the privilege selector in Settings; the record is
kept for backwards compatibility with existing data
Why is this change needed?
A blocker to accessing DMS feature
How was the change implemented?
Updating the main view xml to group_dms_viewer from the deprecated group_dms_user
New unit tests
Unit tests executed by the author
How to test manually
Related links
https://projects.acn.fr/projects/acn-eng/work_packages/978/activity