Update fiscal_year.py

This commit is contained in:
ShashaQin 2016-06-01 11:39:53 +08:00
parent 919b1b9d5b
commit 5dd72fe196

View File

@ -12,7 +12,9 @@ from frappe.model.document import Document
class FiscalYear(Document):
def set_as_default(self):
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name)
frappe.get_doc("Global Defaults").on_update()
global_defaults = frappe.get_doc("Global Defaults")
global_defaults.check_permission("write")
global_defaults.on_update()
# clear cache
frappe.clear_cache()