After further digging, I have found that while the query does not work when editing the field in the grid row, the query works fine in the larger, expanded view. Is there a way to fix it?
It also seems that the datepicker object for the Delivery Date fields are different between the row and this expanded view…currently investigating the difference.
Update: Filter Links Data in Child Table - #2 by PrashantPatil
This solution no longer works.
Solution :
try this
--------------------on .js-------------------------------------
frappe.ui.form.on(“Doctype Name”, “onload”, function(frm) {
frm.fields_dict.childtablename.grid.get_field(‘child_field’).get_query =
function() {
return {
query: "appname.appname.doctype.doctypename.doctypename.methodname",
filters: {
"client":cur_frm.doc.client
}
}
}
});
--------------------------on .py----------------------…
This solution, as seen here:
'Payment Entry': 'Payment'
},
frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(doc, cdt, cdn){
return{
query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet",
filters: {'project': doc.project}
}
}
// expense account
frm.fields_dict['items'].grid.get_field('expense_account').get_query = function(doc) {
if (erpnext.is_perpetual_inventory_enabled(doc.company)) {
return {
filters: {
'report_type': 'Profit and Loss',
'company': doc.company,
"is_group": 0
}
}
}
}
seems that it must be done either before or during setup().
Thanks for reaching out @snv !