diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index 1a4028085a2..296b907282b 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -14,10 +14,10 @@ def get_context(context): context.doc.set_indicator() context.parents = frappe.form_dict.parents - context.payment_ref = frappe.db.get_value("Payment Request", + context.payment_ref = frappe.db.get_value("Payment Request", {"reference_name": frappe.form_dict.name}, "name") context.enabled_checkout = frappe.get_doc("Shopping Cart Settings").enable_checkout - if not context.doc.has_website_permission("read"): + if not frappe.has_website_permission(context.doc): frappe.throw(_("Not Permitted"), frappe.PermissionError)