Merge pull request #5428 from ShashaQin/patch-21

Update fiscal_year.py
This commit is contained in:
Nabin Hait 2016-06-01 12:58:13 +05:30
commit cc07148336

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()