Merge pull request #20592 from byugandhara/develop

fix: Changes done to get valid customer and employee list on payment entry form(#20498)
This commit is contained in:
Deepesh Garg 2020-02-26 12:17:47 +05:30 committed by GitHub
commit 5a2f22258a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -253,6 +253,19 @@ frappe.ui.form.on('Payment Entry', {
frappe.throw(__("Party can only be one of "+ party_types.join(", "))); 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) { if(frm.doc.party) {
$.each(["party", "party_balance", "paid_from", "paid_to", $.each(["party", "party_balance", "paid_from", "paid_to",
"paid_from_account_currency", "paid_from_account_balance", "paid_from_account_currency", "paid_from_account_balance",

View File

@ -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]
]
}
};