Conversation
…parse error Odoo 19's ResUserGroupIdsField widget inserts category names into dynamically generated XML without escaping special characters. The & in "Hazard & Emergency" breaks the XML parser when opening the Access Rights tab on the User form.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical XML parsing issue in Odoo 19 that occurred when displaying user access rights. By standardizing the naming convention of the "Hazard & Emergency" category to "Hazard and Emergency", the change ensures that dynamically generated XML content no longer contains unescaped special characters, thereby resolving the parsing failure and improving application stability. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an XML parsing error by renaming 'Hazard & Emergency' to 'Hazard and Emergency' in spp_security/security/categories.xml, spp_hazard/views/menu.xml, and spp_hazard/security/compliance.yaml. This change is intended to prevent an issue with an Odoo 19 widget that does not correctly escape special characters. I have one suggestion to improve asset naming consistency. You might also consider updating the module name in spp_hazard/__manifest__.py to align with these changes, though it is outside the current diff.
| <menuitem | ||
| id="hazard_main_menu_root" | ||
| name="Hazard & Emergency" | ||
| name="Hazard and Emergency" |
There was a problem hiding this comment.
While you're updating the name, it would be a good idea to also update the associated icon file name for consistency. The web_icon attribute on the next line refers to OpenSPP-Web-Menu_Hazard__Emergency_Icon.png. Consider renaming this file to reflect the new name (e.g., OpenSPP-Web-Menu_Hazard_and_Emergency_Icon.png) and updating the path in the web_icon attribute. This would improve the overall consistency of the codebase.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #97 +/- ##
==========================================
+ Coverage 70.39% 70.46% +0.06%
==========================================
Files 674 695 +21
Lines 37005 38670 +1665
==========================================
+ Hits 26051 27247 +1196
- Misses 10954 11423 +469
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Why is this change needed?
Odoo 19's
ResUserGroupIdsFieldwidget inserts category names into dynamically generated XML without escaping special characters. The&in "Hazard & Emergency" breaks the XML parser when opening the Access Rights tab on the User form (whenspp_mis_demo_v2is installed).How was the change implemented?
spp_security/security/categories.xmlspp_hazard/views/menu.xmlspp_hazard/security/compliance.yamlNew unit tests
Unit tests executed by the author
How to test manually
spp_mis_demo_v2Related links