diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 2192b7bf98..968fb60571 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", diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 2b168d1d76..96e5cd57c3 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() { + return{ + filters: [ + ['Sales Order','docstatus', '=' ,1] + ] + } +}; \ No newline at end of file