Skip to content

Add Submit button and statusbar to all detail forms and use Datetime.now() for membership start_date#21

Merged
gonzalesedwin1123 merged 4 commits into19.0from
change-request-fixes
Feb 10, 2026
Merged

Add Submit button and statusbar to all detail forms and use Datetime.now() for membership start_date#21
gonzalesedwin1123 merged 4 commits into19.0from
change-request-fixes

Conversation

@gonzalesedwin1123
Copy link
Copy Markdown
Member

@gonzalesedwin1123 gonzalesedwin1123 commented Feb 9, 2026

Add header with Submit for Approval / Resubmit buttons and approval state statusbar to all CR detail form views, enabling users to submit directly from the detail form.

Use Datetime.now() for membership start_date fields.Date.today() produces midnight UTC, which displays incorrectly in non-UTC timezones. The membership start_date field is a Datetime, so use fields.Datetime.now() to record the actual time the member was added.

Override the default New button in the All Requests list view to open the create wizard (spp.cr.create.wizard) instead of the form view, matching the behavior of the "New Request" menu item.


Note

Low Risk
Mostly formatting-only doc updates plus a small UI patch that changes how new spp.change.request records are created; risk is limited to change-request list/form create behavior.

Overview
This PR is largely documentation/packaging cleanup: it reflows many module README.rst files and generated static/description/index.html pages (whitespace, tables, line wrapping) without changing functional behavior.

On the tooling side, it updates eslint.config.cjs to lint JS under **/static/src/**/*.js.

For spp_change_request_v2, it drops the bundled data/default_types.xml defaults and adds backend assets (static/src/js/create_change_request.js, static/src/xml/create_change_request_template.xml) that patch the list/form views so the “New” action for spp.change.request opens the create wizard (action_cr_create_wizard) instead of the standard record create flow (gated by group checks).

Written by Cursor Bugbot for commit 9e7eb4b. This will update automatically on new commits. Configure here.

…etail forms

Add header with Submit for Approval / Resubmit buttons and approval
state statusbar to all CR detail form views, enabling users to submit
directly from the detail form.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @gonzalesedwin1123, 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 significantly enhances the user experience for managing change requests by embedding key approval workflow actions and status indicators directly within the detail forms. Users can now submit or resubmit change requests for approval and view their current status at a glance, streamlining the overall process and reducing the need for extra navigation.

Highlights

  • Direct Submission from Detail Forms: Added 'Submit for Approval' and 'Resubmit for Review' buttons directly to the header of all change request detail forms, allowing users to initiate or re-initiate the approval process without navigating away.
  • Approval Status Visualization: Integrated an 'approval_state' status bar widget into the header of each detail form, providing immediate visual feedback on the current approval status (draft, pending, approved, applied) of the change request.
  • Consistent UI Across Forms: Applied a standardized header structure across various change request detail forms, ensuring a consistent user experience for submitting and tracking approval states.
Changelog
  • spp_change_request_v2/views/detail_add_member_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_change_hoh_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_create_group_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_edit_group_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_edit_individual_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_exit_registrant_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_merge_registrants_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_remove_member_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_split_household_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_transfer_member_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
  • spp_change_request_v2/views/detail_update_id_views.xml
    • Added a <header> section to the form view, including 'Submit for Approval' and 'Resubmit for Review' buttons.
    • Integrated an approval_state status bar widget within the new header, displaying the workflow states.
    • Applied minor XML formatting adjustments (e.g., spacing in self-closing tags, indentation for multi-line fields).
Activity
  • The pull request was opened by gonzalesedwin1123.
  • The author provided a description outlining the purpose of adding submission buttons and status bars to detail forms.
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.

fields.Date.today() produces midnight UTC, which displays incorrectly
in non-UTC timezones. The membership start_date field is a Datetime, so
use fields.Datetime.now() to record the actual time the member was added.
Copy link
Copy Markdown

@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 adds a consistent header with submission buttons and a status bar to all change request detail forms. This is a great usability improvement, as it allows users to submit or resubmit a change request directly from the detail view without navigating back to the main CR form. The XML formatting cleanups also improve code readability.

I have one suggestion regarding the implementation. The new <header> block is duplicated across 11 different view files. While this works, it could pose a maintainability challenge in the future. I've left a comment on one of the files with a suggestion to use a QWeb template to centralize this common UI component. This would ensure that any future changes to the header only need to be made in a single location.

Comment on lines +9 to +29
<header>
<button
name="action_submit_for_approval"
string="Submit for Approval"
type="object"
class="btn-primary"
invisible="approval_state != 'draft'"
/>
<button
name="action_submit_for_approval"
string="Resubmit for Review"
type="object"
class="btn-primary"
invisible="approval_state != 'revision'"
/>
<field
name="approval_state"
widget="statusbar"
statusbar_visible="draft,pending,approved,applied"
/>
</header>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce code duplication, consider extracting this common header into a reusable QWeb template. This same header is added to 11 different form views in this PR. By using a template, any future changes to the submission buttons or status bar will only need to be made in one place.

You could define the template in a new or existing XML file (e.g., inside a <templates> tag):

<templates>
    <t t-name="spp_change_request_v2.cr_detail_form_header">
        <header>
            <button
                name="action_submit_for_approval"
                string="Submit for Approval"
                type="object"
                class="btn-primary"
                invisible="approval_state != 'draft'"
            />
            <button
                name="action_submit_for_approval"
                string="Resubmit for Review"
                type="object"
                class="btn-primary"
                invisible="approval_state != 'revision'"
            />
            <field
                name="approval_state"
                widget="statusbar"
                statusbar_visible="draft,pending,approved,applied"
            />
        </header>
    </t>
</templates>

Then, you can replace the <header> block in this file and all other similar detail forms with a single line, as suggested below.

                <t t-call="spp_change_request_v2.cr_detail_form_header"/>

name="approval_state"
widget="statusbar"
statusbar_visible="draft,pending,approved,applied"
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Statusbar references non-existent "applied" state in approval_state

Low Severity

The statusbar uses approval_state field with statusbar_visible="draft,pending,approved,applied", but approval_state (from spp.approval.mixin) only has values: draft, pending, revision, approved, rejected. The value applied doesn't exist in this field. The main change request view correctly uses display_state which includes applied. This inconsistency means detail forms will never display the "Completed" status in their statusbar, even when the change request has been applied.

Additional Locations (2)

Fix in Cursor Fix in Web

@gonzalesedwin1123 gonzalesedwin1123 changed the title feat(spp_change_request_v2): add Submit button and statusbar to all detail forms Add Submit button and statusbar to all detail forms and use Datetime.now() for membership start_date Feb 9, 2026
… All Requests list

  Override the default New button in the All Requests list view to open
  the create wizard (spp.cr.create.wizard) instead of the form view,
  matching the behavior of the "New Request" menu item.

  Follows the same ListController patch pattern used by spp_programs.
t-if="!editedRecord and activeActions.create and props.showButtons and canCreateChangeRequest"
type="button"
class="btn btn-primary o_list_button_add_cr"
accesskey="c"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent keyboard shortcut attribute usage

Low Severity

The "New Request" button uses accesskey="c" while the fallback "New" button on line 22 and all other buttons in the codebase use data-hotkey="c". The accesskey attribute is a native HTML attribute with browser-specific behavior, whereas data-hotkey is Odoo's unified hotkey system that integrates with the framework's keyboard shortcuts dialog and provides consistent cross-platform behavior. This inconsistency means the shortcut will behave differently and won't appear in Odoo's keyboard shortcuts helper.

Fix in Cursor Fix in Web


<t t-inherit="web.FormView" t-inherit-mode="extension">
<xpath expr="//button[hasclass('o_form_button_create')]" position="attributes">
<attribute name="t-if">model.root.resModel != 'spp.change.request'</attribute>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FormView create button loses permission check on t-if override

Medium Severity

The FormView modification uses position="attributes" to set a new t-if condition on the create button, which completely replaces any existing t-if condition. The standard Odoo FormView create button has conditions like activeActions.create to check permissions. The new condition model.root.resModel != 'spp.change.request' only checks the model type, losing the permission checks. This causes the create button to appear in forms even when the user lacks create permission. The ListView modification correctly preserves activeActions.create (line 19), but the FormView modification does not.

Fix in Cursor Fix in Web

…tion and missing CR types

  - Remove deleted default_types.xml and stale manifest comment, since CR
    types are now provided by spp_cr_types_base/spp_cr_types_advanced
  - Add get_or_create_cr_type() and get_or_create_membership_kind() test
    helpers in common.py so tests create required data dynamically instead
    of relying on env.ref() lookups that fail without type modules installed
  - Add CRTestCase base class with shared setup for registrants and CR creation
  - Fix get_or_create_membership_kind() to pass is_local=True when creating
    codes on system vocabularies (required by spp_vocabulary protection)
  - Fix AttributeError in add_member and transfer_member preview strategies:
    spp.vocabulary.code uses 'display' field, not 'name'
  - Remove redundant skipTest guards across all strategy test files
  - Fix JS/XML formatting (prettier)
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

/>
</t>
</t>
</xpath>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Template extensions overwrite existing program create button

High Severity

The new create_change_request_template.xml extends web.ListView using position="replace" on the same xpath (//Layout/t[@t-set-slot='control-panel-create-button']) that spp_programs/static/src/xml/create_program_template.xml already targets. When both modules are installed, the second extension applied completely overwrites the first — causing one module's custom create button (either "Create Program" or "New Request") to silently fall through to the default "New" button. The same conflict occurs for the web.FormView extension, where both set t-if on the same o_form_button_create button, so only one model's create button gets properly hidden.

Additional Locations (1)

Fix in Cursor Fix in Web

@gonzalesedwin1123 gonzalesedwin1123 merged commit 535bbd1 into 19.0 Feb 10, 2026
25 of 28 checks passed
@gonzalesedwin1123 gonzalesedwin1123 deleted the change-request-fixes branch February 10, 2026 02:56
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