Skip to content

fix: standardize marital status options#6193

Open
pjamsheer wants to merge 3 commits into
version-15from
hot-fix
Open

fix: standardize marital status options#6193
pjamsheer wants to merge 3 commits into
version-15from
hot-fix

Conversation

@pjamsheer

@pjamsheer pjamsheer commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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, and Visa 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 Employee DocType 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.txt to ensure they are executed during deployment. [1] [2]

Other Minor Changes:

  • Updated router and Vite config for the frontend to use the correct base paths. [1] [2]
  • Updated modified timestamps in several JSON files to reflect changes. [1] [2] [3] [4]
  • Updated patch comments for clarity and tracking.

These changes ensure consistency in how marital status is represented throughout the system, improve data quality, and simplify maintenance going forward.

Ref:

Screenshot 2026-06-05 at 12 08 11 AM Screenshot 2026-06-05 at 1 05 44 AM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 thread one_fm/patches.txt
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 thread one_fm/patches.txt
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
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