From 4b046160f8f9d43c34c1f9e093d052d4f9ca2e27 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Wed, 27 Nov 2024 15:52:45 +0530 Subject: [PATCH] refactor: Move `PR` link filters to client side (cherry picked from commit 2db2c8bce1c1f453818e7e693ded0c0eec8053ec) --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 4 ++++ .../accounts/doctype/payment_request/payment_request.py | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index a377aa04db2..2d27cccfff8 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -185,6 +185,10 @@ frappe.ui.form.on("Payment Entry", { filters: { reference_doctype: row.reference_doctype, reference_name: row.reference_name, + company: doc.company, + status: ["!=", "Paid"], + outstanding_amount: [">", 0], // for compatibility with old data + docstatus: 1, }, }; }); diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 1d31fd4b67b..27e3aa83092 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -987,12 +987,7 @@ def get_open_payment_requests_query(doctype, txt, searchfield, start, page_len, open_payment_requests = frappe.get_list( "Payment Request", - filters={ - **filters, - "status": ["!=", "Paid"], - "outstanding_amount": ["!=", 0], # for compatibility with old data - "docstatus": 1, - }, + filters=filters, fields=["name", "grand_total", "outstanding_amount"], order_by="transaction_date ASC,creation ASC", )