From e0f35fb85f1550086a4f37306d3700261a8f9121 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 2 Jul 2023 11:25:43 +0530 Subject: [PATCH] fix: Update country names (#21545) * fix: Update country names * fix: revert name back --- frappe/geo/country_info.json | 6 +++--- frappe/patches.txt | 1 + frappe/patches/v14_0/update_country_names.py | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 frappe/patches/v14_0/update_country_names.py diff --git a/frappe/geo/country_info.json b/frappe/geo/country_info.json index f308dc63e3..858b43b883 100644 --- a/frappe/geo/country_info.json +++ b/frappe/geo/country_info.json @@ -669,7 +669,7 @@ "currency_fraction_units": 100, "isd": "+242" }, - "Congo, The Democratic Republic of the": { + "Congo, Democratic Republic of the": { "code": "cd", "number_format": "#,###.##", "currency": "CDF", @@ -2632,7 +2632,7 @@ ], "isd": "+992" }, - "Tanzania": { + "Tanzania, United Republic of": { "code": "tz", "currency": "TZS", "currency_name": "Tanzanian Shilling", @@ -2913,7 +2913,7 @@ "currency_fraction_units": 100, "isd": "+58" }, - "Vietnam": { + "Viet Nam": { "code": "vn", "currency": "VND", "currency_name": "Dong", diff --git a/frappe/patches.txt b/frappe/patches.txt index ebdda9b220..9ce2d0896d 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -226,3 +226,4 @@ frappe.desk.doctype.form_tour.patches.introduce_ui_tours execute:frappe.delete_doc_if_exists("Workspace", "Customization") execute:frappe.db.set_single_value("Document Naming Settings", "default_amend_naming", "Amend Counter") execute:frappe.delete_doc_if_exists("DocType", "Error Snapshot") +frappe.patches.v14_0.update_country_names diff --git a/frappe/patches/v14_0/update_country_names.py b/frappe/patches/v14_0/update_country_names.py new file mode 100644 index 0000000000..272c4ed896 --- /dev/null +++ b/frappe/patches/v14_0/update_country_names.py @@ -0,0 +1,12 @@ +import frappe + + +def execute(): + country_info_map = { + "Tanzania": "Tanzania, United Republic of", + "Vietnam": "Viet Nam", + "Congo, The Democratic Republic of the": "Congo, Democratic Republic of the", + } + + for old, new in country_info_map.items(): + frappe.rename_doc("Country", old, new, force=True)