Skip to content

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Nov 17, 2025

Why is this change needed?

For better optimization when creating and updating custom fields, auto refresh is needed to properly trigger the custom fields UI definition on Group and Individual (Indicator and Additional Details)

How was the change implemented?

Added a JS script to trigger the refresh on successful save, triggered by either creation or update.

New unit tests

None

Unit tests executed by the author

None

How to test manually

  • Install or Update spp_custom_fields_ui
  • Try creating a new custom fields, upon successful creation a refresh should be triggered with 100ms delay (Delay is needed for it to wait fully successful creation
  • Try also updating existing custom field, this should also trigger the refresh (Update have no delay as the record already exists)

Related links


Note

Adds JS patch to reload the custom fields form after successful save (with URL safety guard) and wires it via assets; introduces concise tests for onchange behavior and compute updates.

  • UI/Frontend:
    • Patch FormController.saveButtonClicked to auto-reload after saving ir.model.fields with target_type.
      • Immediate reload for existing records; 100ms delayed reload for new records.
      • URL safety check before delayed reload; proper handling of result === false and errors.
  • Module Configuration:
    • Register JS in web.assets_backend via __manifest__.py.
  • Tests:
    • Add test_10_onchange_field_category, test_11_onchange_kinds, test_12_onchange_target_type; call _onchange_has_presence() for coverage.
    • Create fields with correct types and assert compute updates accordingly; retain type-change error test.
  • Docs:
    • Add CHANGELOG.md capturing fixes, safety check, and test additions.

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

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.24%. Comparing base (9bc1eed) to head (8df8aed).
⚠️ Report is 2 commits behind head on 17.0.

Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #874      +/-   ##
==========================================
+ Coverage   81.22%   81.24%   +0.01%     
==========================================
  Files         818      818              
  Lines       24956    24975      +19     
  Branches     2917     2917              
==========================================
+ Hits        20270    20290      +20     
+ Misses       3953     3950       -3     
- Partials      733      735       +2     

☔ 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.

@emjay0921 emjay0921 marked this pull request as ready for review November 20, 2025 01:59
@emjay0921 emjay0921 removed the request for review from reichie020212 November 20, 2025 01:59
Copy link

@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.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@sonarqubecloud
Copy link

@gonzalesedwin1123 gonzalesedwin1123 merged commit 7de3cde into 17.0 Nov 21, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants