blob: 5cb3ff23ddc4c3b39ea85367a8150834575f36d5 [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
Saurabh0a0c7872016-01-04 17:37:54 +053016 context.payment_ref = frappe.db.get_value("Payment Request",
17 {"reference_name": frappe.form_dict.name}, "name")
Saurabh883cc042016-01-21 15:43:07 +053018
19 context.enabled_checkout = frappe.get_doc("Shopping Cart Settings").enable_checkout
20
21 print context.enabled_checkout
Saurabh0a0c7872016-01-04 17:37:54 +053022
Anand Doshi199d8a42015-09-28 19:04:42 +053023 if not context.doc.has_website_permission("read"):
Rushabh Mehta156ce602015-09-11 18:49:59 +053024 frappe.throw(_("Not Permitted"), frappe.PermissionError)