added chart of accounts
This commit is contained in:
parent
6b4e9534a8
commit
dc9d2c3247
|
|
@ -1,8 +1,10 @@
|
||||||
from az_locale.locale.setup_locale import setup_locale
|
from az_locale.locale.setup_locale import setup_locale
|
||||||
|
from az_locale.locale.setup_chart import setup_chart
|
||||||
from az_locale.locale.update_languages import update_languages
|
from az_locale.locale.update_languages import update_languages
|
||||||
from az_locale.locale.update_country import update_country
|
from az_locale.locale.update_country import update_country
|
||||||
|
|
||||||
def after_install():
|
def after_install():
|
||||||
setup_locale() # Добавляем файлы локализации
|
setup_locale()
|
||||||
|
setup_chart()
|
||||||
update_languages()
|
update_languages()
|
||||||
update_country()
|
update_country()
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,29 @@
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
from frappe.utils import get_bench_path
|
||||||
|
|
||||||
|
def setup_chart():
|
||||||
|
try:
|
||||||
|
bench_path = get_bench_path()
|
||||||
|
|
||||||
|
# Пути назначения
|
||||||
|
erpnext_locale_path = os.path.join(bench_path, "apps", "erpnext", "erpnext", "accounts", "doctype", "account", "chart_of_accounts", "verified", "az_chart_of_accounts.json")
|
||||||
|
|
||||||
|
# Создаём директорию, если она не существует
|
||||||
|
# os.makedirs(os.path.dirname(erpnext_locale_path), exist_ok=True)
|
||||||
|
|
||||||
|
# Пути к файлам в кастомном приложении
|
||||||
|
app_path = os.path.join(bench_path, "apps", "az_locale", "az_locale", "locale")
|
||||||
|
source_erpnext = os.path.join(app_path, "az_chart_of_accounts.json")
|
||||||
|
|
||||||
|
# Копируем файл для ERPNext
|
||||||
|
if os.path.exists(source_erpnext):
|
||||||
|
shutil.copy(source_erpnext, erpnext_locale_path)
|
||||||
|
print(f"План счетов успешно установлен в {erpnext_locale_path}")
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print(f"Ошибка: Файл источника {source_erpnext} не найден")
|
||||||
|
return False
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Произошла ошибка при установке плана счетов: {str(e)}")
|
||||||
|
return False
|
||||||
Loading…
Reference in New Issue