fix: standardize marital status options#6193
Open
pjamsheer wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes “Marital Status” values across backend DocTypes, frontend selection UIs, and introduces migration patches to normalize existing records while removing legacy Employee property-setter customization.
Changes:
- Standardized marital status option lists in multiple DocTypes/custom fields and in applicant-facing HTML/Vue pages.
- Added migration patches (data normalization + removal of legacy Employee property setter) and registered them in
patches.txt. - Updated the magic-link frontend build output and base/routing configuration to match the deployed asset paths.
Reviewed changes
Copilot reviewed 16 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| one_fm/www/one_fm_job_applicaton/index.html | Fixes “Divorced” option typo in job application page. |
| one_fm/visa_management/doctype/visa_request/visa_request.json | Updates Visa Request marital status options + modified timestamp. |
| one_fm/templates/pages/applicant_docs.html | Updates marital status options in applicant docs page. |
| one_fm/public/magic_link/index.html | Adjusts asset/favicon paths for deployed magic-link app. |
| one_fm/public/magic_link/assets/InsertVideo.js | Rebuilt bundle output; now imports shared Dialog module. |
| one_fm/public/magic_link/assets/InsertLink.js | Rebuilt bundle output; now imports shared Dialog module. |
| one_fm/public/magic_link/assets/InsertImage.js | Rebuilt bundle output; now imports shared Dialog module. |
| one_fm/public/magic_link/assets/Home.js | Rebuilt bundle output (includes updated bundled dependencies + template updates). |
| one_fm/public/magic_link/assets/FontColor.js | Rebuilt bundle output; Popover/Tooltip implementation changes. |
| one_fm/public/magic_link/assets/Dialog.js | New built asset providing Dialog component used by other bundles. |
| one_fm/patches/v15_0/standardize_marital_status_options.py | New patch to migrate legacy marital-status values to standardized ones. |
| one_fm/patches/v15_0/remove_employee_marital_status_property_setter.py | New patch removing legacy Employee property setter for marital_status options. |
| one_fm/patches.txt | Registers new patches and adjusts comments/spacing. |
| one_fm/one_fm/doctype/pam_visa/pam_visa.json | Standardizes PAM Visa marital status options + modified timestamp. |
| one_fm/hiring/doctype/transfer_paper/transfer_paper.json | Updates modified timestamp for Transfer Paper. |
| one_fm/hiring/doctype/onboard_employee/onboard_employee.json | Standardizes Onboard Employee marital status options + modified timestamp. |
| one_fm/grd/doctype/work_permit/work_permit.json | Updates modified timestamp for Work Permit. |
| one_fm/custom/property_setter/employee.py | Removes Employee marital_status “options” property setter definition. |
| one_fm/custom/custom_field/job_applicant.py | Standardizes Job Applicant custom-field marital status options. |
| job_applicant_magic_link/vite.config.js | Sets Vite base for correct deployed asset paths. |
| job_applicant_magic_link/src/router.js | Updates router history base path. |
| job_applicant_magic_link/src/pages/Home.vue | Updates marital status options in magic-link UI. |
Files not reviewed (5)
- one_fm/public/magic_link/assets/Dialog.js: Language not supported
- one_fm/public/magic_link/assets/FontColor.js: Language not supported
- one_fm/public/magic_link/assets/InsertImage.js: Language not supported
- one_fm/public/magic_link/assets/InsertLink.js: Language not supported
- one_fm/public/magic_link/assets/InsertVideo.js: Language not supported
Comments suppressed due to low confidence (1)
one_fm/templates/pages/applicant_docs.html:225
- The Marital Status select markup has a stray
>after the Jinja{% endif %}and an extra</select>closing tag, which results in invalid HTML and can break rendering of the form controls.
<option value="Divorced">Divorced</option>
{% if job_applicant.one_fm_marital_status != None %}
<option value="{{ job_applicant.one_fm_marital_status }}" selected>{{ job_applicant.one_fm_marital_status }}</option>
{% endif %}>
</select>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+13
| import frappe | ||
| from frappe.desk.reportview import get_count | ||
| from frappe.query_builder import DocType, Field | ||
| from frappe.query_builder.functions import Count |
| "Unknown": "Single", | ||
| } | ||
|
|
||
| old_values = list(marital_status_mapping.keys()) |
Comment on lines
+45
to
+55
| # Update Onboard Employee marital status field using Query Builder | ||
| OnboardEmployee = DocType("Onboard Employee") | ||
|
|
||
| for old_value, new_value in marital_status_mapping.items(): | ||
| if old_value != new_value: | ||
| ( | ||
| frappe.qb.update(OnboardEmployee) | ||
| .set(OnboardEmployee.marital_status, new_value) | ||
| .where(OnboardEmployee.marital_status == old_value) | ||
| ).run() | ||
|
|
Comment on lines
+18
to
+20
| Migrate marital status data from old options to new standardized options | ||
| across Job Applicant, Onboard Employee, Work Permit, Transfer Paper, and PAM Visa | ||
| using Query Builder for optimal performance |
Comment on lines
298
to
+299
| one_fm.patches.v15_0.update_job_offer_day_off_category_for_job_applicants | ||
| one_fm.patches.v15_0.remove_employee_marital_status_property_setter |
Comment on lines
409
to
+410
| one_fm.patches.v15_0.add_resignation_fields_to_employee | ||
| one_fm.patches.v15_0.standardize_marital_status_options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request standardizes the "Marital Status" options across all modules and updates both the backend and frontend to use a consistent set of values. It also includes patches to migrate existing data to the new standardized options and removes legacy property setters that are no longer needed.
Standardization of Marital Status Options:
Updated all relevant DocTypes (
Job Applicant,Onboard Employee,Work Permit,Transfer Paper,PAM Visa, andVisa Request) to use the standardized options: "Single", "Married", "Divorced", and "Widowed", replacing previous values like "Unmarried", "Divorce", "Widow", and "Unknown". [1] [2] [3] [4]Added a patch (
standardize_marital_status_options.py) to migrate all existing records to the new options, mapping old values to the new standardized ones in all affected DocTypes.Updated the frontend (
Home.vue) to reflect the new options for user selection.Cleanup and Migration:
Removed the property setter that previously defined marital status options on the
EmployeeDocType and added a patch (remove_employee_marital_status_property_setter.py) to ensure this is cleaned up during migration. [1] [2]Registered the new patches in
patches.txtto ensure they are executed during deployment. [1] [2]Other Minor Changes:
modifiedtimestamps in several JSON files to reflect changes. [1] [2] [3] [4]These changes ensure consistency in how marital status is represented throughout the system, improve data quality, and simplify maintenance going forward.
Ref: