I have created a MultiSelectDialog to select items from the Reel Form Doctype. I want to filter the child table where the weight is not equal to 0. Here is the code snippet:
get_query() {
return {
filters: [
['docstatus', '=', 1],
['warehouse', '=',cur_frm.doc.source_warehouse], ]
};
},
This filter is only applied to the Reel Form Doctype, and I cannot apply it to the Child Doctype.
new frappe.ui.form.MultiSelectDialog({
size : 'large',
doctype: "Reel Form",
target: frm,
setters: [,
{
fieldtype: 'Link',
label: __('Warehouse'),
options: 'Warehouse',
fieldname: 'warehouse',
default: cur_frm.doc.source_warehouse
}],
add_filters_group: 1,
data_field: "item_name",
allow_child_item_selection: 1,
child_fieldname: "items",
child_columns: ["item_name", "reel_name", "weight"],
get_query() {
return {
filters: [
['docstatus', '=', 1],
['warehouse', '=',cur_frm.doc.source_warehouse], ]
};
},