Merge pull request #31927 from sokumon/sync-system-settings

fix: sync currency field on migrate
This commit is contained in:
Soham Kulkarni 2025-03-27 16:08:48 +05:30 committed by GitHub
commit bd1c0470e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -2,6 +2,7 @@
# License: MIT. See LICENSE
import frappe
import frappe.defaults
from frappe import _
from frappe.model import no_value_fields
from frappe.model.document import Document
@ -240,3 +241,8 @@ def clear_system_settings_cache():
frappe.client_cache.delete_value(cache_key)
frappe.cache.delete_value("system_settings")
frappe.cache.delete_value("time_zone")
def sync_system_settings():
if frappe.db.get_single_value("System Settings", "currency") is None:
frappe.db.set_single_value("System Settings", "currency", frappe.defaults.get_defaults()["currency"])

View file

@ -244,3 +244,4 @@ frappe.desk.doctype.workspace.patches.update_app
frappe.patches.v16_0.move_role_desk_settings_to_user
frappe.printing.doctype.print_format.patches.sets_wkhtmltopdf_as_default_for_pdf_generator_field
frappe.patches.v14_0.fix_user_settings_collation
execute:frappe.core.doctype.system_settings.system_settings.sync_system_settings