[fix] Payment Entry - draft sales invoices should not be selectable
This commit is contained in:
parent
4c0f9dac94
commit
5ea8c97b7c
@ -78,6 +78,20 @@ frappe.ui.form.on('Payment Entry', {
|
||||
filters: { "name": ["in", doctypes] }
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("reference_name", "references", function(doc, cdt, cdn) {
|
||||
child = locals[cdt][cdn];
|
||||
filters = {"docstatus": 1, "company": doc.company};
|
||||
party_type_doctypes = ['Sales Invoice', 'Sales Order', 'Purchase Invoice', 'Purchase Order'];
|
||||
|
||||
if (in_list(party_type_doctypes, child.reference_doctype)) {
|
||||
filters[doc.party_type.toLowerCase()] = doc.party;
|
||||
}
|
||||
|
||||
return {
|
||||
filters: filters
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user