-
Notifications
You must be signed in to change notification settings - Fork 24
[NEW] spp_registry_name_suffix #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] spp_registry_name_suffix #879
Conversation
- Add spp.name.suffix model for configurable suffixes (Jr., Sr., III, PhD, etc.) - Extend res.partner with suffix_id field and name_change method - Add configuration menu under Registry > Configuration > Name Suffixes - Include default suffix data and unit tests
- Extend name_change method from g2p_registry_individual instead of _compute_name from spp_registrant_import (optional module) - Fix tests to use env.ref() for existing suffix data records - Update tests to use Form() helper for onchange simulation
Fix SonarQube issue: Remove this deprecated 'tt' element in static/description/index.html
There was a problem hiding this 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.
Add PhD, MD, and Esq. suffix records that were missing from the data file.
Tests were failing because env.ref('spp_registry_name_suffix.suffix_phd')
could not find the record.
- Remove uniqueness tests that caused transaction/savepoint issues - Add test to verify default suffix data is loaded correctly - SQL unique constraints are still enforced by the database
… constraint Tests were failing because res.partner has a check constraint (res_partner_check_name) requiring a non-empty name at INSERT time. Since name_change() is an onchange method that doesn't run during programmatic create, we provide a temporary placeholder name that gets overwritten when name_change() is called.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 17.0 #879 +/- ##
==========================================
+ Coverage 81.26% 81.35% +0.08%
==========================================
Files 815 821 +6
Lines 24957 25105 +148
Branches 2914 2928 +14
==========================================
+ Hits 20281 20423 +142
- Misses 3944 3946 +2
- Partials 732 736 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…eve 100% coverage Add tests for the name_get method to cover: - Display with different code than name (shows 'Name (CODE)') - Display when code equals name (shows only 'Name') - Handling of multiple records in recordset
aldnav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gonzalesedwin1123. Thank you for considering this feature. Real great use for us.
I reviewed the PR and left some comments. Please let me know what you think. 🙏
Change suffix field from Many2one to Many2many to allow selecting multiple suffixes (e.g., 'Jr., PhD'). Suffixes are displayed in sequence order. Updated views to use many2many_tags widget and added comprehensive tests for multiple suffix scenarios.
…lusive suffixes Add exclusion_group field to prevent incompatible suffixes from being selected together. Generational suffixes (Jr., Sr., Jra., I-XV) are now in the 'generational' group and cannot coexist. Academic/professional suffixes (PhD, MD, Esq.) have no exclusion group and can be freely combined.
…rational field Replace exclusion_group (Char) with is_generational (Boolean) to prevent typographical errors in configuration. Generational suffixes (Jr., Sr., I-XV) are now marked with a simple checkbox, and the constraint ensures only one generational suffix can be selected per individual.
|



Why is this change needed?
An optional module for adding a suffix in the individual registrant name needs to be created to support implementations that requires it. A series of suffixes can also be added to the name of individual to support for example "DELA CRUZ, JUAN X, SR., PHD". This series cannot be set with suffixes belonging to the same group. Example: "JR" and "SR" cannot be assigned to an individual.
How was the change implemented?
Created a new module named spp_registry_name_suffix.
New unit tests
Unit tests executed by the author
How to test manually
Related links
Note
Introduces a new module adding configurable name suffixes and UI integration for individuals, with validation, data, and tests.
spp_registry_name_suffixspp.name.suffixwith fields (name,code,sequence,active,description,is_generational) and unique constraints; customname_get.res.partnerwithsuffix_ids(Many2many) and constraint allowing only one generational suffix; enhancename_changeto append ordered suffixes tonamefor individuals.spp.name.suffix(tree/form/search), window action, and menu underRegistry > Configuration.suffix_idsto individual form (afteraddl_name) and list views as tags.ir.model.access.csv.name_get, and generational exclusivity.pyproject.toml), and documentation (README, static description).Written by Cursor Bugbot for commit 5dd04cd. This will update automatically on new commits. Configure here.