From 066c054549d99fe74fe27ef701386251fa84c5d5 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 | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 038a72f2711..398dacc6f51 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 eb8fcc96b50..21d4b860d1f 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -48,6 +48,10 @@ def get_context(context): ) context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points")) + 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 -- GitLab From 65434714a6ffe868f29ae6fa69823529f178e592 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 --- .../buying/doctype/buying_settings/buying_settings.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index f7da64918ce..7b7619aaeca 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -149,6 +149,13 @@ "fieldtype": "Check", "label": "Disable Last Purchase Rate" }, + { + "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" + }, { "default": "0", "depends_on": "eval: !doc.maintain_same_rate", @@ -207,7 +214,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", -- GitLab