Skip to content

feat(spp_change_request_v2): CR UX redesign with stage-based workflow#61

Open
emjay0921 wants to merge 2 commits into19.0from
feat/cr-wizard-ux-redesign
Open

feat(spp_change_request_v2): CR UX redesign with stage-based workflow#61
emjay0921 wants to merge 2 commits into19.0from
feat/cr-wizard-ux-redesign

Conversation

@emjay0921
Copy link
Contributor

Why is this change needed?

Syncs the latest CR UX redesign changes from openspp-modules-v2 (PR #299). The module has diverged significantly since the initial port (PR #29, merged Feb 11) with substantial improvements made after Feb 23.

How was the change implemented?

  • Stage-based workflow: 3-stage CR creation (Edit Details → Upload Documents → Review & Submit)
  • Audit logging: New spp.change.request.log model tracking all state transitions
  • Document validation: Required documents check before submission, missing docs indicator
  • Flexible registrant: CR types like "Create Group" no longer require selecting a registrant
  • Review comparison: HTML comparison table replacing split-pane view
  • Revision wizard: Override for approval revision flow with CR-specific redirect
  • Conflict detection: Improved conflict mixin and rule handling
  • UX improvements: Stage banners, document review widget, role-based access (CR Manager), ribbons, Start Over button
  • Bug fixes: sudo() for strategy calls blocked by record rules, Odoo 19 _() variable naming fix, no_create/no_open on lookup fields

Also includes minor fix in spp_dms (remove downloadUrl from file viewer).

New unit tests

Updated existing tests to match new workflow (stage navigation, document validation)

Unit tests executed by the author

spp_change_request_v2 tests pass (28 tests, 0 failures) in openspp-modules-v2

How to test manually

  1. Install/upgrade spp_change_request_v2
  2. Create a new CR — verify 3-stage flow works
  3. Upload documents — verify required doc validation
  4. Submit for approval — verify review comparison table
  5. Approve/reject/request revision — verify audit log entries

Related links

openspp-modules-v2 PR: OpenSPP/openspp-modules-v2#299

Stage-based CR workflow, audit logging, document validation,
flexible registrant, review comparison, revision wizard,
conflict detection improvements, and UX fixes.
changes = strategy.preview(rec) or {}
# Use sudo to bypass record rules (e.g. global disabled-registrant
# rules on spp.group.membership) — this is read-only preview logic.
sudo_rec = rec.sudo()

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
changes = strategy.preview(sudo_self) or {}
except Exception as e:
_logger.warning("Error computing preview for CR ID %s: %s", self.id, e)
return (

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
@@ -720,27 +976,153 @@ def _generate_preview_html(self):
else:

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
changes = strategy.preview(sudo_self) or {}
except Exception as e:
_logger.warning("Error computing review comparison for CR ID %s: %s", self.id, e)
return (

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
changes = strategy.preview(sudo_self) or {}
self.preview_json_snapshot = json.dumps(changes, indent=2, default=str)

def action_apply(self):

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
strategy.apply(sudo_self)

def action_preview_changes(self):
"""Preview what changes will be applied (returns data dict)."""

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
"change_request_id": self.id,
"action": action,
"user_id": self.env.user.id,
"notes": notes,

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
data["details"] = details

self.env["spp.event.data"].sudo().create( # nosemgrep: odoo-sudo-without-context
self.env["spp.event.data"].sudo().create(

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.odoo-sudo-without-context Warning

sudo() bypasses all access controls. Ensure this is: Intentional and documented Using minimal scope (e.g., .sudo().read(['field']) not .sudo()) Not exposing sensitive data to unauthorized users
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 introduces a significant redesign of the Change Request (CR) user experience, moving from a monolithic form to a structured, stage-based workflow. The changes aim to improve clarity, enforce data integrity, and enhance the overall usability of the CR system. Key improvements include a guided creation process, detailed activity logging, and more robust document and conflict management, ensuring a smoother and more controlled experience for users and validators.

Highlights

  • Stage-Based Workflow for Change Request Creation: Implemented a new 3-stage process for creating Change Requests (CRs): 'Edit Details', 'Upload Documents', and 'Review & Submit'. This guides users through the CR creation process more intuitively.
  • Comprehensive Audit Logging: Introduced a new spp.change.request.log model to meticulously track all state transitions and key actions within a Change Request, providing a clear history of its lifecycle.
  • Enhanced Document Management and Validation: Added required document checks before CR submission, including visual indicators for missing documents. Document preview and download functionalities were also refined, and a new widget for reviewing documents was introduced.
  • Flexible Registrant Selection: Updated CR types, such as 'Create Group', to no longer strictly require selecting a registrant at the initial stage, allowing for more flexible workflows.
  • Improved Review Comparison and Revision Flow: Replaced the previous split-pane view with a new HTML comparison table for reviewing proposed changes. The revision request flow now includes a specific redirect to the CR list with a notification.
  • Refined Conflict Detection and Rule Handling: Improved the logic for conflict detection, including better handling of record rules by using sudo() for preview and apply operations to bypass permission issues for system actions.
  • User Experience Enhancements: Incorporated various UX improvements such as stage banners, role-based access for CR Managers, and a 'Start Over' button for rejected CRs, streamlining the user interaction.
Changelog
  • spp_change_request_v2/manifest.py
    • Updated development_status from 'Production/Stable' to 'Stable'.
    • Added new XML views for stage-based forms: stage_documents_form.xml and stage_review_form.xml.
    • Included new static assets: cr_review_documents.js and cr_review_documents.xml.
  • spp_change_request_v2/data/default_types.xml
    • Added a new data file defining various default change request types and their configurations.
    • Set is_requires_registrant to 0 for the 'Create New Group' CR type.
  • spp_change_request_v2/data/dms_directories.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/data/event_types.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/data/sequences.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/data/user_roles.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/details/add_member.py
    • Applied minor formatting adjustment to the domain tuple.
  • spp_change_request_v2/details/change_hoh.py
    • Applied minor formatting adjustment to the domain tuple.
  • spp_change_request_v2/details/merge_registrants.py
    • Applied minor formatting adjustment to a ValidationError message.
  • spp_change_request_v2/details/split_household.py
    • Changed the default value of copy_address from True to False.
    • Simplified the lambda function used for filtering non-head memberships.
    • Applied minor formatting adjustment to a ValidationError message.
    • Modified _onchange_copy_address to clear address fields when copy_address is untoggled.
  • spp_change_request_v2/details/transfer_member.py
    • Applied minor formatting adjustment to the domain tuple.
  • spp_change_request_v2/models/init.py
    • Imported the new change_request_log module.
  • spp_change_request_v2/models/change_request.py
    • Added allow_document_download as a related field.
    • Introduced a new stage field to manage the 3-stage CR creation workflow.
    • Added is_cr_manager computed field for role-based access.
    • Removed required=True from registrant_id to support CR types without an initial registrant.
    • Added log_ids One2many field to link to the new spp.change.request.log model.
    • Updated display_state labels from 'Declined' to 'Rejected' and 'Completed' to 'Applied'.
    • Added review_comparison_html, review_comparison_html_snapshot, and review_documents_html fields for enhanced review capabilities.
    • Introduced missing_required_document_ids, documents_complete, stage_banner_html, and required_documents_html computed fields.
    • Modified _compute_has_proposed_changes to use sudo() for strategy preview to bypass record rules.
    • Enhanced _compute_multitier_approval_message to display current and next approver groups.
    • Added new methods: _compute_stage_banner_html, _compute_missing_required_documents, _compute_required_documents_html, _compute_review_comparison_html, _compute_review_documents_html.
    • Applied minor HTML formatting adjustments in _compute_registrant_summary_html.
    • Integrated _create_log calls into various CR lifecycle methods (create, _on_approve, _on_reject, _on_submit, _on_request_revision, _on_reset_to_draft, action_apply).
    • Removed nosemgrep comment from _ensure_detail and _create_audit_event.
    • Overrode action_approve to log intermediate tier approvals in multi-tier workflows.
    • Modified action_submit_for_approval to redirect to the CR list and provide improved notifications.
    • Added self.modified(['approval_state']) in _on_approve to trigger recomputation of stored computed fields.
    • Set self.stage in _on_request_revision and _on_reset_to_draft for stage navigation.
    • Modified _generate_preview_html to use sudo() and provide a clearer 'No changes' message.
    • Added _generate_review_comparison_html, _render_comparison_table, _render_action_summary, and _format_review_value methods for review comparison.
    • Updated _capture_preview_snapshot to capture review_comparison_html_snapshot and use sudo().
    • Ensured _do_apply uses sudo() for system actions.
    • Updated action_open_detail to use the views parameter instead of view_id.
    • Added stage navigation methods: action_open_stage_form, action_goto_details, action_start_over, action_save_and_go_to_list, action_goto_documents, action_goto_review.
  • spp_change_request_v2/models/change_request_conflict.py
    • Applied minor formatting adjustments to message_post bodies.
  • spp_change_request_v2/models/change_request_detail_base.py
    • Added is_cr_manager computed field.
    • Added stage as a related field.
    • Introduced action_save_and_go_to_list and action_next_documents methods for workflow navigation.
  • spp_change_request_v2/models/change_request_log.py
    • Added a new model spp.change.request.log to track CR state transitions and actions.
  • spp_change_request_v2/models/change_request_type.py
    • Added is_requires_registrant field, defaulting to True.
    • Added allow_document_download field to control document download access.
  • spp_change_request_v2/models/conflict_mixin.py
    • Removed nosemgrep comment from _create_conflict_audit_event.
  • spp_change_request_v2/models/conflict_rule.py
    • Applied minor formatting adjustment to the get_conflict_message method.
  • spp_change_request_v2/models/dms_file.py
    • Defined PREVIEWABLE_MIMETYPES for document preview functionality.
    • Added is_previewable computed field.
    • Implemented action_preview, action_download, and action_remove_from_cr methods.
  • spp_change_request_v2/models/duplicate_config.py
    • Applied minor formatting adjustment to the check_fields help text.
  • spp_change_request_v2/security/compliance.yaml
    • Applied minor YAML formatting adjustments.
  • spp_change_request_v2/security/groups.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/security/ir.model.access.csv
    • Added access rules for the new spp.change.request.log model.
  • spp_change_request_v2/security/privileges.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/security/rules.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/static/src/components/global_shortcuts/global_shortcuts.js
    • Simplified notification messages for approval/rejection permissions.
  • spp_change_request_v2/static/src/components/review_panel/review_panel.js
    • Simplified orm.call and orm.read invocations for preview and approval review data.
  • spp_change_request_v2/static/src/components/review_panel/review_panel.xml
    • Applied minor XML formatting adjustments and simplified t-foreach for changes.
  • spp_change_request_v2/static/src/js/cr_review_documents.js
    • Added a new JavaScript file defining the CRReviewDocuments widget for displaying and previewing documents within the review stage.
  • spp_change_request_v2/static/src/js/create_change_request.js
    • Simplified actionService.doAction calls.
    • Introduced navigateCRStage and navigateCRList client actions for improved navigation.
    • Patched ListController.prototype to override openRecord for stage-specific routing and onCustomListCreate for CR creation.
    • Updated is_cr_user check to is_cr_manager for role-based access.
  • spp_change_request_v2/static/src/js/search_delay_field.js
    • Added onWillUnmount import for component lifecycle management.
  • spp_change_request_v2/static/src/xml/cr_review_documents.xml
    • Added a new XML template for the CRReviewDocuments widget.
  • spp_change_request_v2/static/src/xml/cr_search_results_field.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/static/src/xml/search_delay_field.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/strategies/field_mapping.py
    • Removed nosemgrep comment from _eval_expression.
    • Modified preview method to return field labels and display-friendly values for comparison.
  • spp_change_request_v2/strategies/update_id.py
    • Applied minor formatting adjustment to a UserError message.
  • spp_change_request_v2/tests/common.py
    • Applied minor formatting adjustment in get_or_create_membership_kind.
  • spp_change_request_v2/tests/test_apply_strategies.py
    • Updated test_field_mapping_preview to assert against field labels instead of raw field names.
  • spp_change_request_v2/tests/test_conflict_detection_extended.py
    • Assigned created CRs and related records to variables for consistency in tests.
  • spp_change_request_v2/tests/test_e2e_workflows.py
    • Assigned created records to variables for consistency in tests.
  • spp_change_request_v2/tests/test_split_household_strategy.py
    • Assigned created membership to a variable for consistency in tests.
  • spp_change_request_v2/tests/test_transfer_member_strategy.py
    • Removed ValidationError import and broadened assertRaises to Exception.
  • spp_change_request_v2/tests/test_ux_wizards.py
    • Updated comment for action_create_draft result.
    • Renamed cr variable to change_request to avoid Odoo 19 _() conflict.
    • Updated lambda argument name in latest_line for consistency.
  • spp_change_request_v2/views/batch_approval_wizard_views.xml
    • Applied minor XML formatting adjustments.
    • Added an action_remove_line button to the batch approval list.
    • Made line_ids field readonly.
  • spp_change_request_v2/views/change_request_type_views.xml
    • Applied minor XML formatting adjustments.
    • Added is_requires_registrant field.
    • Added allow_document_download field.
  • spp_change_request_v2/views/change_request_views.xml
    • Applied minor XML formatting adjustments.
    • Changed action_apply button string to 'Apply'.
    • Added groups="spp_change_request_v2.group_cr_manager" to action_apply and action_reset_to_draft buttons.
    • Added web_ribbon elements for 'Applied' and 'Rejected' states.
    • Removed groups="base.group_no_one" from action_open_preview_wizard.
    • Removed options from registrant_id and applicant_id fields.
    • Removed force_save="1" from revision_notes.
  • spp_change_request_v2/views/conflict_comparison_wizard_views.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/conflict_extensions.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/conflict_rule_views.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/conflict_wizard_views.xml
    • Applied minor XML formatting adjustments and improved UserError message.
  • spp_change_request_v2/views/create_wizard_views.xml
    • Added target_type_message field.
    • Updated action_create_draft button's invisible condition.
    • Removed options from registrant_id and applicant_id fields.
  • spp_change_request_v2/views/detail_add_member_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Added options="{'no_open': True}" to registrant_id.
  • spp_change_request_v2/views/detail_change_hoh_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
  • spp_change_request_v2/views/detail_create_group_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Removed options from group_type_id, state_id, and country_id.
  • spp_change_request_v2/views/detail_edit_group_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Added an info alert.
    • Converted notebook pages to groups.
    • Added options="{'no_open': True}" to registrant_id.
  • spp_change_request_v2/views/detail_edit_individual_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Added an info alert.
    • Converted notebook pages to groups.
  • spp_change_request_v2/views/detail_exit_registrant_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
  • spp_change_request_v2/views/detail_merge_registrants_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
  • spp_change_request_v2/views/detail_remove_member_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
  • spp_change_request_v2/views/detail_split_household_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Changed stat button icons.
    • Added nolabel="1" and colspan="2" to registrant_member_to_split_ids.
    • Added string="New Head of Household" to new_head_individual_id.
    • Added force_save="1" to address and contact fields.
  • spp_change_request_v2/views/detail_transfer_member_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Removed options from new_role_id.
  • spp_change_request_v2/views/detail_update_id_views.xml
    • Set form to readonly="not is_cr_manager".
    • Replaced action_proceed_to_cr buttons with action_next_documents and action_save_and_go_to_list.
    • Updated statusbar to use stage instead of approval_state.
    • Added is_cr_manager field.
    • Removed options from id_type_id.
  • spp_change_request_v2/views/dms_file_views.xml
    • Applied minor XML formatting adjustments.
    • Removed downloadUrl from preview_widget in the kanban view.
  • spp_change_request_v2/views/document_upload_wizard_views.xml
    • Applied minor XML formatting adjustments.
    • Removed directory_id and required_categories_text fields.
    • Made filename field invisible.
  • spp_change_request_v2/views/menus.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/preview_changes_wizard_views.xml
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/queue_views.xml
    • Removed quick action buttons from the list view.
    • Applied minor XML formatting adjustments.
  • spp_change_request_v2/views/stage_documents_form.xml
    • Added a new XML view defining the form for the 'Upload Documents' stage of a Change Request.
  • spp_change_request_v2/views/stage_review_form.xml
    • Added a new XML view defining the form for the 'Review & Submit' stage of a Change Request.
  • spp_change_request_v2/wizards/init.py
    • Imported the new revision_wizard module.
  • spp_change_request_v2/wizards/batch_approval_wizard.py
    • Updated lambda argument name in action_confirm for clarity.
    • Added action_remove_line method to allow removal of lines from the batch wizard.
  • spp_change_request_v2/wizards/conflict_comparison_wizard.py
    • Updated lambda argument names in _compute_comparison_html, action_approve_latest_decline_others, and action_approve_oldest_decline_others for clarity.
  • spp_change_request_v2/wizards/conflict_wizard.py
    • Applied minor formatting adjustments in _build_comparison_table.
    • Improved UserError and ValidationError messages for clarity.
  • spp_change_request_v2/wizards/create_wizard.py
    • Added target_type_message computed field.
    • Modified _compute_show_registrant to account for is_requires_registrant.
    • Implemented _compute_target_type_message to provide context on registrant type.
    • Applied minor formatting in _compute_registrant_info.
    • Modified action_create_draft to validate is_requires_registrant and renamed cr variable to change_request to avoid Odoo 19 _() conflict.
  • spp_change_request_v2/wizards/document_upload_wizard.py
    • Applied minor formatting adjustment to a UserError message.
  • spp_change_request_v2/wizards/preview_changes_wizard.py
    • Applied minor formatting adjustment in _compute_preview_html.
  • spp_change_request_v2/wizards/revision_wizard.py
    • Added a new wizard that overrides action_request_revision to redirect to the CR list with a notification.
  • spp_dms/static/src/js/preview_binary_field.esm.js
    • Removed downloadUrl from fileViewer.open options.
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.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 53.21337% with 182 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.66%. Comparing base (a72ada0) to head (90a3eec).

Files with missing lines Patch % Lines
spp_change_request_v2/models/change_request.py 48.49% 120 Missing ⚠️
spp_change_request_v2/details/split_household.py 0.00% 11 Missing ⚠️
spp_change_request_v2/models/dms_file.py 42.10% 11 Missing ⚠️
spp_change_request_v2/wizards/create_wizard.py 62.96% 10 Missing ⚠️
...ge_request_v2/models/change_request_detail_base.py 38.46% 8 Missing ⚠️
spp_change_request_v2/tests/test_ux_wizards.py 45.45% 6 Missing ⚠️
spp_change_request_v2/wizards/revision_wizard.py 40.00% 6 Missing ⚠️
...change_request_v2/wizards/batch_approval_wizard.py 25.00% 3 Missing ⚠️
...e_request_v2/wizards/conflict_comparison_wizard.py 0.00% 3 Missing ⚠️
spp_change_request_v2/models/change_request_log.py 86.66% 2 Missing ⚠️
... and 2 more

❗ There is a different number of reports uploaded between BASE (a72ada0) and HEAD (90a3eec). Click for more details.

HEAD has 7 uploads less than BASE
Flag BASE (a72ada0) HEAD (90a3eec)
spp_api_v2_cycles 1 0
spp_api_v2_products 1 0
spp_api_v2_service_points 1 0
spp_api_v2_data 1 0
spp_api_v2_entitlements 1 0
spp_aggregation 1 0
spp_api_v2 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             19.0      #61      +/-   ##
==========================================
- Coverage   71.36%   64.66%   -6.70%     
==========================================
  Files         319      274      -45     
  Lines       25878    21278    -4600     
==========================================
- Hits        18467    13760    -4707     
- Misses       7411     7518     +107     
Flag Coverage Δ
spp_aggregation ?
spp_api_v2 ?
spp_api_v2_change_request 73.97% <ø> (ø)
spp_api_v2_cycles ?
spp_api_v2_data ?
spp_api_v2_entitlements ?
spp_api_v2_products ?
spp_api_v2_service_points ?
spp_base_common 92.81% <ø> (ø)
spp_change_request_v2 70.88% <53.21%> (?)
spp_cr_types_advanced 98.43% <ø> (?)
spp_cr_types_base 98.50% <ø> (?)
spp_dci_demo 84.78% <ø> (?)
spp_dms 86.19% <ø> (?)
spp_mis_demo_v2 74.77% <ø> (?)
spp_programs 49.56% <ø> (ø)
spp_security 51.08% <ø> (?)
spp_starter_social_registry 87.50% <ø> (?)
spp_starter_sp_mis 86.95% <ø> (?)
spp_studio_change_requests 90.23% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 introduces a significant and well-executed UX redesign for the Change Request module, shifting to a stage-based workflow. The changes are comprehensive, including new models for audit logging, stage-specific forms, and various UI enhancements. The use of sudo() in read-only and post-approval operations is well-justified. The code is clean and demonstrates good practices, including forward-looking fixes for compatibility with upcoming Odoo versions. I've identified a couple of minor inconsistencies in the JavaScript code that could be addressed for improved maintainability.

/** @odoo-module **/

import {Component, useEffect, useRef} from "@odoo/owl";
import {Component, useEffect, useRef, onWillUnmount} from "@odoo/owl";

Choose a reason for hiding this comment

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

medium

The onWillUnmount hook is imported but not used within the SearchDelayField component. It can be removed to keep the imports clean.

Suggested change
import {Component, useEffect, useRef, onWillUnmount} from "@odoo/owl";
import {Component, useEffect, useRef} from "@odoo/owl";

Comment on lines +59 to +66
this.fileViewer.open({
isImage: Boolean(record.mimetype.startsWith("image/")),
isVideo: Boolean(record.mimetype.startsWith("video/")),
isViewable: true,
displayName: record.name,
defaultSource: fileUrl,
downloadUrl: fileUrl,
});

Choose a reason for hiding this comment

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

medium

For consistency with the change made in spp_dms/static/src/js/preview_binary_field.esm.js and the PR description, the downloadUrl property should probably be removed from the fileViewer.open() call. It seems this property might be deprecated or no longer necessary.

            this.fileViewer.open({
                isImage: Boolean(record.mimetype.startsWith("image/")),
                isVideo: Boolean(record.mimetype.startsWith("video/")),
                isViewable: true,
                displayName: record.name,
                defaultSource: fileUrl,
            });

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.

1 participant