From cea4ed6f88af9ab226aa8bdcfdecf9b08cecc664 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 30 Jan 2024 17:24:59 +0530 Subject: [PATCH 1/3] 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 97bf48727cf..6c59a9688dc 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 d0968bf88a2..21d4b860d1f 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 e9314325cc3e2e2a8665f36220d658856b8e802a Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 31 Jan 2024 13:37:01 +0530 Subject: [PATCH 2/3] fix: conditionally display show btn setting (cherry picked from commit 0c9572bb489c7b1cc12b38e3308f987dd61f162f) # Conflicts: # erpnext/buying/doctype/buying_settings/buying_settings.json --- erpnext/buying/doctype/buying_settings/buying_settings.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 77ce5f7d193..7e57bbf2df6 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -151,6 +151,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" @@ -213,7 +214,11 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], +<<<<<<< HEAD "modified": "2024-01-30 14:04:43.177427", +======= + "modified": "2024-01-31 13:34:18.101256", +>>>>>>> 0c9572bb48 (fix: conditionally display show btn setting) "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", From 510ab769f15f41d7773ec70efad30c7f4b084e92 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 31 Jan 2024 15:23:14 +0530 Subject: [PATCH 3/3] chore: fix conflicts --- erpnext/buying/doctype/buying_settings/buying_settings.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 7e57bbf2df6..ae854f29343 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -214,11 +214,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], -<<<<<<< HEAD - "modified": "2024-01-30 14:04:43.177427", -======= "modified": "2024-01-31 13:34:18.101256", ->>>>>>> 0c9572bb48 (fix: conditionally display show btn setting) "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", @@ -268,4 +264,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +}