Skip to content

Conversation

@Jatin3128
Copy link
Contributor

Added a temporary field and mapped it to the country field.
Screenshot 2025-12-31 at 4 48 13 AM

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

This pull request modifies the contact address quick entry utility to introduce a country_address alias that maps to the underlying country field. The field renaming is propagated through the form mapping and field dependency declarations, updating references in Address Line 1 and City fields to depend on country_address instead of country. The Country field declaration is updated to use the new country_address fieldname while retaining its Link field type and mandatory status.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

backport version-15-hotfix

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly relates to the changeset, describing the fix for avoiding a mandatory_depends_on trigger from prefetched country in quick entry.
Description check ✅ Passed The description is related to the changeset, mentioning the temporary field mapping to country field to prevent the mandatory_depends_on trigger.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb5926f and a450f7a.

📒 Files selected for processing (1)
  • erpnext/public/js/utils/contact_address_quick_entry.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (2)
erpnext/public/js/utils/contact_address_quick_entry.js (2)

26-26: LGTM! Alias mapping follows established pattern.

The country_address alias is correctly added to the mapping object, consistent with the existing pattern for email_address, mobile_number, etc. This ensures the field is properly converted back to country before document insertion.


80-80: All field dependencies consistently updated across the codebase.

The field references have been systematically updated:

  • Address Line 1 (line 80): mandatory when city or country_address is filled
  • City (line 99): mandatory when country_address or address_line1 is filled
  • Country field (line 108): fieldname changed from "country" to "country_address"; mandatory when city or address_line1 is filled

This ensures prefetched country values won't trigger mandatory dependencies. The circular dependency logic is intact: filling any one of these three fields makes the others mandatory.

Verification confirmed no other files reference doc.country in dependency expressions, so no additional updates are needed elsewhere.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ruthra-kumar ruthra-kumar self-assigned this Jan 7, 2026
@ruthra-kumar ruthra-kumar merged commit dd94e51 into frappe:develop Jan 7, 2026
13 checks passed
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