Added currency azn to hooks
This commit is contained in:
parent
a44873d7dd
commit
8c4af6c7d3
|
|
@ -1,8 +1,10 @@
|
||||||
from az_locale.geo.update_country_info import update_country_info
|
from az_locale.geo.update_country_info import update_country_info
|
||||||
from az_locale.locale.setup_locale import setup_locale
|
from az_locale.locale.setup_locale import setup_locale
|
||||||
from az_locale.locale.update_languages import update_languages # Добавили новый импорт
|
from az_locale.locale.update_languages import update_languages
|
||||||
|
from az_locale.setup.setup_currency import setup_currency
|
||||||
|
|
||||||
def after_install():
|
def after_install():
|
||||||
update_country_info() # Обновляем страны
|
update_country_info() # Обновляем страны
|
||||||
setup_locale() # Добавляем файлы локализации
|
setup_locale() # Добавляем файлы локализации
|
||||||
update_languages() # Добавляем азербайджанский язык
|
update_languages() # Добавляем азербайджанский язык
|
||||||
|
setup_currency() # Добавляем валюту AZN
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def setup_currency():
|
||||||
|
if not frappe.db.exists("Currency", "AZN"):
|
||||||
|
currency = frappe.get_doc({
|
||||||
|
"doctype": "Currency",
|
||||||
|
"currency_name": "Azerbaijani Manat",
|
||||||
|
"symbol": "₼",
|
||||||
|
"fraction": "Qəpik",
|
||||||
|
"fraction_units": 100,
|
||||||
|
"smallest_currency_fraction_value": 0.01,
|
||||||
|
"number_format": "#,###.##",
|
||||||
|
"enabled": 1,
|
||||||
|
"name": "AZN"
|
||||||
|
})
|
||||||
|
currency.insert(ignore_permissions=True)
|
||||||
|
frappe.db.commit()
|
||||||
|
print("✅ Валюта AZN успешно добавлена!")
|
||||||
|
else:
|
||||||
|
print("⚠️ Валюта AZN уже существует!")
|
||||||
Loading…
Reference in New Issue