Skip to content

Commit

Permalink
fix: store and use default currency from system settings
Browse files Browse the repository at this point in the history
  • Loading branch information
NagariaHussain committed Nov 4, 2024
1 parent 2983878 commit 4657938
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions frappe/core/doctype/system_settings/system_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"language",
"column_break_3",
"time_zone",
"currency",
"enable_onboarding",
"setup_complete",
"disable_document_sharing",
Expand Down Expand Up @@ -684,12 +685,19 @@
"fieldname": "use_number_format_from_currency",
"fieldtype": "Check",
"label": "Use Number Format from Currency"
},
{
"description": "Default display currency",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
"options": "Currency"
}
],
"icon": "fa fa-cog",
"issingle": 1,
"links": [],
"modified": "2024-09-26 16:20:59.417151",
"modified": "2024-11-04 15:51:39.954876",
"modified_by": "Administrator",
"module": "Core",
"name": "System Settings",
Expand All @@ -708,4 +716,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}
1 change: 1 addition & 0 deletions frappe/core/doctype/system_settings/system_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SystemSettings(Document):
bypass_2fa_for_retricted_ip_users: DF.Check
bypass_restrict_ip_check_if_2fa_enabled: DF.Check
country: DF.Link | None
currency: DF.Link | None
currency_precision: DF.Literal["", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
date_format: DF.Literal[
"yyyy-mm-dd", "dd-mm-yyyy", "dd/mm/yyyy", "dd.mm.yyyy", "mm/dd/yyyy", "mm-dd-yyyy"
Expand Down
1 change: 1 addition & 0 deletions frappe/desk/page/setup_wizard/setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def update_system_settings(args): # nosemgrep
"country": args.get("country"),
"language": get_language_code(args.get("language")) or "en",
"time_zone": args.get("timezone"),
"currency": args.get("currency"),
"float_precision": 3,
"rounding_method": "Banker's Rounding",
"date_format": frappe.db.get_value("Country", args.get("country"), "date_format"),
Expand Down

0 comments on commit 4657938

Please sign in to comment.