Hi,
There are in erpnext/accounts/doctype/account/chart_of_account/unverified several other template country related for charts of accounts.
I’d like to make one of these as a standard default for my company, or if needed a new one : How can we activate them and make them appear in the system ?
This would avoid to customize a chart of account folder by folder which is time consuming when job is already done, and to use the correct accounting architecture ?
Thanks,
Hubert
Edit : in fact I think it somewhere ahas to do with thes cod apart :
@frappe.whitelist()
def get_charts_for_country(country):
charts = []
def _get_chart_name(content):
if content:
content = json.loads(content)
if content and content.get("is_active", "No") == "Yes" and content.get("disabled", "No") == "No":
charts.append(content["name"])
country_code = frappe.db.get_value("Country", country, "code")
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",
# "Replica of Democratic Congo", "Senegal", "Chad", "Togo"]
#
# if country in countries_use_OHADA_system:
# with open(os.path.join(os.path.dirname(__file__), "syscohada_syscohada_chart_template.json"), "r") as f:
# _get_chart_name(f.read())
if len(charts) != 1:
#charts.append("Standard")
return charts
Any help please ?