From ae7be84d873cee0b0ea35614804a249ea56c05bb Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 30 Jan 2024 17:24:59 +0530 Subject: [PATCH 1/2] fix(portal): show PO pay button if payments installed --- 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 From 0c9572bb489c7b1cc12b38e3308f987dd61f162f Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 31 Jan 2024 13:37:01 +0530 Subject: [PATCH 2/2] fix: conditionally display show btn setting --- erpnext/buying/doctype/buying_settings/buying_settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index ddcbd555ae..c531a2ae9f 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -152,6 +152,7 @@ }, { "default": "1", + "depends_on": "eval: frappe.boot.versions && frappe.boot.versions.payments", "fieldname": "show_pay_button", "fieldtype": "Check", "label": "Show Pay Button in Purchase Order Portal" @@ -214,7 +215,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2024-01-12 16:42:01.894346", + "modified": "2024-01-31 13:34:18.101256", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings",