From cea4ed6f88af9ab226aa8bdcfdecf9b08cecc664 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 30 Jan 2024 17:24:59 +0530 Subject: [PATCH] fix(portal): show PO pay button if payments installed (cherry picked from commit ae7be84d873cee0b0ea35614804a249ea56c05bb) --- erpnext/templates/pages/order.html | 12 ++++++++++++ erpnext/templates/pages/order.py | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 97bf48727c..6c59a9688d 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -34,6 +34,18 @@ + {% if show_pay_button %} +
+ +
+ {% endif %} {% endblock %} diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index d0968bf88a..21d4b860d1 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -48,7 +48,10 @@ def get_context(context): ) context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points")) - context.show_pay_button = frappe.db.get_single_value("Buying Settings", "show_pay_button") + context.show_pay_button = ( + "payments" in frappe.get_installed_apps() + and frappe.db.get_single_value("Buying Settings", "show_pay_button") + ) context.show_make_pi_button = False if context.doc.get("supplier"): # show Make Purchase Invoice button based on permission