From ad645afeb2b20c11222f5b0b55ac15c088ade718 Mon Sep 17 00:00:00 2001 From: Yugandhara Date: Sat, 15 Feb 2020 10:56:41 +0530 Subject: [PATCH 1/4] fix: Changes done to get valid customer and employee list on payment entry form --- .../accounts/doctype/payment_entry/payment_entry.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 2192b7bf989..968fb605713 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -253,6 +253,19 @@ frappe.ui.form.on('Payment Entry', { 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", From af2b39891e097bf1db55e549410c331377c92595 Mon Sep 17 00:00:00 2001 From: Yugandhara Date: Sat, 15 Feb 2020 16:01:41 +0530 Subject: [PATCH 2/4] fix: Changes done to get valid sales order list on sales order child table of production plan --- .../doctype/production_plan/production_plan.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 2b168d1d76d..4e92ee2d0a8 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -296,3 +296,11 @@ frappe.ui.form.on("Material Request Plan Item", { } } }); + +cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function(doc, cdt, cdn) { + return{ + filters: [ + ['Sales Order','docstatus', '=' ,1] + ] + } +}; \ No newline at end of file From e997168a2364f9350441d1aac7e03c293556c77f Mon Sep 17 00:00:00 2001 From: Yugandhara Date: Sat, 15 Feb 2020 16:14:46 +0530 Subject: [PATCH 3/4] fix: unused variable cdn removed --- .../manufacturing/doctype/production_plan/production_plan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 4e92ee2d0a8..d400d59a134 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -297,7 +297,7 @@ frappe.ui.form.on("Material Request Plan Item", { } }); -cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function(doc) { return{ filters: [ ['Sales Order','docstatus', '=' ,1] From ce1f6a73e22588b7e274af5d4d302f7d64deb59c Mon Sep 17 00:00:00 2001 From: Yugandhara Date: Sat, 15 Feb 2020 16:31:53 +0530 Subject: [PATCH 4/4] fix: Changes done to get valid sales order list on production plan form(#20609) --- .../manufacturing/doctype/production_plan/production_plan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index d400d59a134..96e5cd57c35 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -297,7 +297,7 @@ frappe.ui.form.on("Material Request Plan Item", { } }); -cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function(doc) { +cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = function() { return{ filters: [ ['Sales Order','docstatus', '=' ,1]