From 5dd72fe1962d9bdf9f18e98ebeaa86f518a6dd42 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Wed, 1 Jun 2016 11:39:53 +0800 Subject: [PATCH] Update fiscal_year.py --- erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 2fd838b509..2ff98da983 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -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()