From 5cbfecc299b690ce5851adc8a671fe9f7510263d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 13 Aug 2015 13:01:40 +0530 Subject: [PATCH] [minor] added currency for Ghana, fixes frappe/erpnext#3795 --- frappe/geo/country_info.json | 1 + frappe/patches.txt | 1 + frappe/patches/v6_0/fix_ghana_currency.py | 7 +++++++ frappe/utils/install.py | 6 ++++-- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 frappe/patches/v6_0/fix_ghana_currency.py diff --git a/frappe/geo/country_info.json b/frappe/geo/country_info.json index f33977c6b2..4f41e385a2 100644 --- a/frappe/geo/country_info.json +++ b/frappe/geo/country_info.json @@ -911,6 +911,7 @@ }, "Ghana": { "code": "gh", + "currency": "GHS", "currency_fraction": "Pesewa", "currency_fraction_units": 100, "currency_symbol": "\u20b5", diff --git a/frappe/patches.txt b/frappe/patches.txt index 61f2ea4e23..fd4848aaed 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -88,3 +88,4 @@ frappe.patches.v5_3.rename_chinese_languages frappe.patches.v6_0.make_task_log_folder frappe.patches.v6_0.document_type_rename +frappe.patches.v6_0.fix_ghana_currency diff --git a/frappe/patches/v6_0/fix_ghana_currency.py b/frappe/patches/v6_0/fix_ghana_currency.py new file mode 100644 index 0000000000..10365148b1 --- /dev/null +++ b/frappe/patches/v6_0/fix_ghana_currency.py @@ -0,0 +1,7 @@ + +def execute(): + from frappe.geo.country_info import get_all + import frappe.utils.install + + countries = get_all() + frappe.utils.install.add_country_and_currency("Ghana", frappe._dict(countries["Ghana"])) diff --git a/frappe/utils/install.py b/frappe/utils/install.py index 204638e11a..10d30f5a2b 100644 --- a/frappe/utils/install.py +++ b/frappe/utils/install.py @@ -106,7 +106,8 @@ def add_country_and_currency(name, country): "country_name": name, "code": country.code, "date_format": country.date_format or "dd-mm-yyyy", - "time_zones": "\n".join(country.timezones or []) + "time_zones": "\n".join(country.timezones or []), + "docstatus": 0 }).db_insert() if country.currency and not frappe.db.exists("Currency", country.currency): @@ -116,6 +117,7 @@ def add_country_and_currency(name, country): "fraction": country.currency_fraction, "symbol": country.currency_symbol, "fraction_units": country.currency_fraction_units, - "number_format": country.number_format + "number_format": country.number_format, + "docstatus": 0 }).db_insert()