Skip to content

fix: use System Settings currency as CRM base currency instead of defaulting to USD - #2832

Draft
Shindhu-Ramaswamy wants to merge 1 commit into
frappe:developfrom
Shindhu-Ramaswamy:fix-default-currency-from-system-settings
Draft

Shindhu-Ramaswamy wants to merge 1 commit into
frappe:developfrom
Shindhu-Ramaswamy:fix-default-currency-from-system-settings

Conversation

@Shindhu-Ramaswamy

@Shindhu-Ramaswamy Shindhu-Ramaswamy commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1117

Changes

  • Add get_base_currency() in crm/utils — resolves FCRM Settings.currency → System Settings.currency → USD, and use it in the dashboard, Deal and Organization exchange-rate code instead of the hard-coded USD fallback.
  • Seed FCRM Settings.currency from System Settings on after_install and on setup_wizard_complete (the wizard runs after install on a fresh site).
  • Patch to backfill the currency for existing sites that never set one.
  • Tests for the fallback order and the seeding logic.

@mergify

mergify Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "fix: use System Settings currency as CRM..."

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.18182% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.29%. Comparing base (4ddcbbc) to head (46354a7).

Files with missing lines Patch % Lines
crm/install.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2832      +/-   ##
===========================================
+ Coverage    71.18%   71.29%   +0.10%     
===========================================
  Files          175      176       +1     
  Lines        12360    12410      +50     
===========================================
+ Hits          8799     8848      +49     
- Misses        3561     3562       +1     
Files with missing lines Coverage Δ
crm/api/dashboard.py 90.54% <100.00%> (ø)
crm/fcrm/doctype/crm_deal/crm_deal.py 90.45% <100.00%> (+0.04%) ⬆️
.../fcrm/doctype/crm_organization/crm_organization.py 82.60% <100.00%> (+0.79%) ⬆️
crm/hooks.py 100.00% <100.00%> (ø)
crm/tests/test_default_currency.py 100.00% <100.00%> (ø)
crm/utils/__init__.py 94.77% <100.00%> (+0.06%) ⬆️
crm/install.py 16.66% <87.50%> (+3.07%) ⬆️
🚀 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.

@Shindhu-Ramaswamy
Shindhu-Ramaswamy marked this pull request as draft September 16, 2026 05:57
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.

Change default currency

2 participants