brotherton-erpnext/erpnext/patches/v8_0/save_system_settings.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
487 B
Python
Raw Normal View History

# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
2017-06-26 07:44:52 +00:00
from frappe.utils import cint
def execute():
"""
save system settings document
"""
frappe.reload_doc("core", "doctype", "system_settings")
2017-06-26 07:44:52 +00:00
doc = frappe.get_doc("System Settings")
doc.flags.ignore_mandatory = True
2017-06-26 07:44:52 +00:00
if cint(doc.currency_precision) == 0:
doc.currency_precision = ''
doc.save(ignore_permissions=True)