Fixed Countrywise Chart of Accounts patch

This commit is contained in:
Anand Doshi
2014-03-25 13:50:52 +05:30
parent 06a595090d
commit 7fbdba02ab
4 changed files with 16 additions and 13 deletions

View File

@@ -23,13 +23,14 @@ def import_country_and_currency():
for name in data:
country = frappe._dict(data[name])
frappe.doc({
"doctype": "Country",
"country_name": name,
"code": country.code,
"date_format": country.date_format or "dd-mm-yyyy",
"time_zones": "\n".join(country.timezones or [])
}).insert()
if not frappe.db.exists("Country", name):
frappe.doc({
"doctype": "Country",
"country_name": name,
"code": country.code,
"date_format": country.date_format or "dd-mm-yyyy",
"time_zones": "\n".join(country.timezones or [])
}).insert()
if country.currency and not frappe.db.exists("Currency", country.currency):
frappe.doc({