From d7ef5ad95573a2616191811edf09242a7535fc3d Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Tue, 7 Feb 2023 14:43:10 +0530 Subject: [PATCH 1/2] chore: add field `show_pay_button` in Buying Settings --- .../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 34417f7ac3..652dcf0d43 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -21,6 +21,7 @@ "allow_multiple_items", "bill_for_rejected_quantity_in_purchase_invoice", "disable_last_purchase_rate", + "show_pay_button", "subcontract", "backflush_raw_materials_of_subcontract_based_on", "column_break_11", @@ -140,6 +141,12 @@ "fieldname": "disable_last_purchase_rate", "fieldtype": "Check", "label": "Disable Last Purchase Rate" + }, + { + "default": "1", + "fieldname": "show_pay_button", + "fieldtype": "Check", + "label": "Show Pay Button in Purchase Order Portal" } ], "icon": "fa fa-cog", @@ -147,7 +154,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2023-01-09 17:08:28.828173", + "modified": "2023-02-15 14:42:10.200679", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", From 20bdc63b037187a6375f3d2958633270b82b5e2d Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Wed, 8 Feb 2023 15:02:39 +0530 Subject: [PATCH 2/2] fix: show Purchase Order Portal `Pay` button based on configuration --- erpnext/templates/pages/order.html | 20 +++++++++++--------- erpnext/templates/pages/order.py | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 6b354b2fab..bc34ad5ac5 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -34,16 +34,18 @@ - {% endblock %} diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index 185ec6615f..13772d3129 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -55,6 +55,7 @@ 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_make_pi_button = False if context.doc.get("supplier"): # show Make Purchase Invoice button based on permission