Merge pull request #20592 from byugandhara/develop
fix: Changes done to get valid customer and employee list on payment entry form(#20498)
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 2192b7b..968fb60 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -253,6 +253,19 @@
frappe.throw(__("Party can only be one of "+ party_types.join(", ")));
}
+ frm.set_query("party", function() {
+ if(frm.doc.party_type == 'Employee'){
+ return {
+ query: "erpnext.controllers.queries.employee_query"
+ }
+ }
+ else if(frm.doc.party_type == 'Customer'){
+ return {
+ query: "erpnext.controllers.queries.customer_query"
+ }
+ }
+ });
+
if(frm.doc.party) {
$.each(["party", "party_balance", "paid_from", "paid_to",
"paid_from_account_currency", "paid_from_account_balance",
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js
index 2b168d1..96e5cd5 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.js
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js
@@ -296,3 +296,11 @@
}
}
});
+
+cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function() {
+ return{
+ filters: [
+ ['Sales Order','docstatus', '=' ,1]
+ ]
+ }
+};
\ No newline at end of file