2015-09-11 13:19:59 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
from frappe import _
|
|
|
|
|
|
|
|
def get_context(context):
|
|
|
|
context.no_cache = 1
|
2016-04-20 10:50:49 +00:00
|
|
|
context.show_sidebar = True
|
2015-09-11 13:19:59 +00:00
|
|
|
context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
|
2015-09-16 13:22:52 +00:00
|
|
|
if hasattr(context.doc, "set_indicator"):
|
|
|
|
context.doc.set_indicator()
|
|
|
|
|
2015-09-11 13:19:59 +00:00
|
|
|
context.parents = frappe.form_dict.parents
|
2016-10-12 05:01:08 +00:00
|
|
|
context.payment_ref = frappe.db.get_value("Payment Request",
|
2016-01-04 12:07:54 +00:00
|
|
|
{"reference_name": frappe.form_dict.name}, "name")
|
2016-09-21 11:19:58 +00:00
|
|
|
|
2016-01-21 10:13:07 +00:00
|
|
|
context.enabled_checkout = frappe.get_doc("Shopping Cart Settings").enable_checkout
|
2016-09-21 11:19:58 +00:00
|
|
|
|
2016-10-12 05:01:08 +00:00
|
|
|
if not frappe.has_website_permission(context.doc):
|
2015-09-11 13:19:59 +00:00
|
|
|
frappe.throw(_("Not Permitted"), frappe.PermissionError)
|