Hi
My case:
In BOM form I need to filter item (finished goods) and items’s (raw material) item_codes by BOM’s field project. (Item master contain field Project). On BOM show only these items that have the same project in Items master.
It works, if I use some global value like ‘SomeInterestingProjectName’ in filters:
frappe.ui.form.on("BOM", "project", function(cur_frm) {
cur_frm.fields_dict['item'].get_query = function(cur_frm) {
return {
filters: [[
'Item', 'project', '=', 'SomeInterestingProjectName'
]]
}
};
});
But if I use in filters value from ‘cur_frm.doc.project’ or ‘cur_frm.fields_dict.project.value’ it shows:
In browsers console I can print both values ‘cur_frm.doc.project’ and ‘cur_frm.fields_dict.project.value’.