Hello All,
I had found a resolution one of my queries but another one is still not reflecting as expected.
While creating BOM, now I able to show only filtered Item Groups with below code.[WORKING]
cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
return{
filters:[
['Item', 'item_group', 'in', ['Products', 'Sub Assemblies']]
]
}
}
and while to filer Raw Items/Materials by which BOM will be finished is still note get solved, I actually restrict only a few “Item Groups” Finished Items, like Product, Services, Sub Assemblies which actually no need to make this list more complicated.
However, I tried below code. [NOT WORKING]
cur_frm.fields_dict['items'].get_query = function(doc, cdt, cdn) {
return{
filters:[
['BOM Item', 'item_group', '!=', ['Products', 'Sub Assemblies']]
]
}
}
also tested, ‘Items’ instead of ‘BOM Item’, but don’t know why not resolved.
Oh Yeah, I can do same 1st code mentioned in this answer, to show many Item Groups but what will be after creating new Item Group. I have to manually add this everytime here in Custom Script, which is not feasible.
Any good solution?