get standard chart of account if country code not found

This commit is contained in:
Nabin Hait 2015-04-20 11:51:16 +05:30
parent 80f8b7be2f
commit 44aaa56000

View File

@ -85,11 +85,12 @@ def get_charts_for_country(country):
charts.append(content["name"])
country_code = frappe.db.get_value("Country", country, "code")
path = os.path.join(os.path.dirname(__file__), "verified")
for fname in os.listdir(path):
if fname.startswith(country_code) and fname.endswith(".json"):
with open(os.path.join(path, fname), "r") as f:
_get_chart_name(f.read())
if country_code:
path = os.path.join(os.path.dirname(__file__), "verified")
for fname in os.listdir(path):
if fname.startswith(country_code) and fname.endswith(".json"):
with open(os.path.join(path, fname), "r") as f:
_get_chart_name(f.read())
countries_use_OHADA_system = ["Benin", "Burkina Faso", "Cameroon", "Central African Republic", "Comoros",
"Congo", "Ivory Coast", "Gabon", "Guinea", "Guinea Bissau", "Equatorial Guinea", "Mali", "Niger",