Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

23 рядки
807 B

  1. # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. # License: GNU General Public License v3. See license.txt
  3. from __future__ import unicode_literals
  4. import frappe
  5. from frappe.utils import get_number_format_info
  6. def execute():
  7. frappe.reload_doc('core', 'doctype', 'system_settings', force=True)
  8. if not frappe.db.get_value("System Settings", None, "currency_precision"):
  9. default_currency = frappe.db.get_default("currency")
  10. number_format = frappe.db.get_value("Currency", default_currency, "number_format") \
  11. or frappe.db.get_default("number_format")
  12. if number_format:
  13. precision = get_number_format_info(number_format)[2]
  14. else:
  15. precision = 2
  16. ss = frappe.get_doc("System Settings")
  17. ss.currency_precision = precision
  18. ss.flags.ignore_mandatory = True
  19. ss.save()