fix: store and use default currency from system settings
This commit is contained in:
parent
29838789d2
commit
465793849c
3 changed files with 12 additions and 2 deletions
|
|
@ -11,6 +11,7 @@
|
|||
"language",
|
||||
"column_break_3",
|
||||
"time_zone",
|
||||
"currency",
|
||||
"enable_onboarding",
|
||||
"setup_complete",
|
||||
"disable_document_sharing",
|
||||
|
|
@ -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",
|
||||
|
|
@ -708,4 +716,4 @@
|
|||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue