blob: 36444d1f30866032b39bbd55580733ea7f884cda [file] [log] [blame]
Rushabh Mehta156ce602015-09-11 18:49:59 +05301# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import frappe
6
7from frappe import _
8
9def get_context(context):
10 context.no_cache = 1
11 context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
Rushabh Mehta3d766862015-09-16 18:52:52 +053012 if hasattr(context.doc, "set_indicator"):
13 context.doc.set_indicator()
14
Rushabh Mehta156ce602015-09-11 18:49:59 +053015 context.parents = frappe.form_dict.parents
16
17 if not context.doc.has_permission("read"):
18 frappe.throw(_("Not Permitted"), frappe.PermissionError)