Skip to content

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Feb 12, 2026

Why is this change needed?

  1. Duplicate "Emergency Response" tabs and stat buttons appeared on registrant forms due to view inheritance chain.
  2. Empty Emergency Response tab showed blank page with no guidance.
  3. Impact records and incidents remained editable after being closed.
  4. Module was at Alpha status but ready for Beta.

How was the change implemented?

  • Removed view_group_form_hazardview_groups_form_membership inherits from view_individuals_form, so one hazard view covers both.
  • Added empty state message in Emergency Response tab.
  • Added readonly="verification_status == 'closed'" to all editable fields in impact form.
  • Added readonly="status == 'closed'" to all editable fields in incident form.
  • Set development_status to Beta, added emjay0921 as maintainer.
  • Removed OCA banner from README/HTML.

New unit tests

Unit tests executed by the author

How to test manually

  • Open any registrant — verify only one "Emergency Response" tab
  • Open registrant with no impacts — should show "No emergency response records yet..." message
  • Open a closed incident — all fields should be readonly
  • Open a closed impact record — all fields should be readonly
  • Verify "Reset to Reported" button still works to unlock a closed impact

Related links

…t form

view_groups_form_membership inherits from view_individuals_form, so
the individual hazard view already covers both individual and group
registrants. The separate group view caused duplicate tabs and stat
buttons.
@gemini-code-assist
Copy link

Summary of Changes

Hello @emjay0921, 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 resolves a user interface bug that caused duplicate 'Emergency Response' tabs and 'Impacts' stat buttons to appear on registrant forms. The duplication was a result of an unnecessary view_group_form_hazard definition, which was redundant because the view_individual_form_hazard already covered both individual and group registrant forms through its inheritance chain. By removing the superfluous view, the UI now correctly displays a single instance of these elements, streamlining the user experience and improving code maintainability.

Highlights

  • Duplicate UI Elements Resolved: Addressed an issue where 'Emergency Response' tabs and 'Impacts' stat buttons were appearing in duplicate on registrant forms, affecting both individual and group registrants.
  • Redundant View Removal: Eliminated the view_group_form_hazard record, which was found to be redundant as the view_individual_form_hazard already correctly applied to both individual and group contexts through existing inheritance.
Changelog
  • spp_hazard/views/registrant_views.xml
    • Removed the view_group_form_hazard record to prevent duplicate UI elements on registrant forms.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request resolves a UI bug where the "Emergency Response" tab and "Impacts" stat button were duplicated on registrant forms. The root cause was a redundant Odoo view (view_group_form_hazard) that applied the same UI elements as an existing view due to a chain of view inheritances. The fix correctly removes this redundant view, relying on the view_individual_form_hazard which already handles both individual and group registrants. The change is clean, effective, and improves code maintainability by removing unnecessary code.

Display informative text when no hazard impact records exist instead
of showing a blank page.
@gonzalesedwin1123 gonzalesedwin1123 merged commit bf42ea2 into 19.0 Feb 12, 2026
10 of 11 checks passed
@gonzalesedwin1123 gonzalesedwin1123 deleted the fix/hazard-duplicate-emergency-response branch February 12, 2026 04:13
@emjay0921 emjay0921 changed the title fix(spp_hazard): remove duplicate Emergency Response tab in registrant form feat(spp_hazard): promote to Beta with UX improvements Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants