I want to filter items on Material Request form. basically I want group wise material request (In one material request items should be same groups of items)
I have add a custom field called item group in material request filed and add a custom script to filter the items.but my script is not working. Kindly help.
Yes sir, I have added a item group link filed in my material request form.
Still not works for me,even console log also not showing. I have also tried with refresh.
Here is my code:
@Sangram
The below code is worked after bench restart, But the code is working until I refresh the browser.
After refresh the browser again the code is not working. Kindly share if you get any solution.
cur_frm.cscript.item_group = function(doc, cdt, cdn) {
cur_frm.set_query(“item_code”, “items”, function(){
return{
query: “erpnext.controllers.queries.item_query”,
filters:{ ‘item_group’: cur_frm.doc.item_group }
}
There are query written in material_request.js as well as in buying controller purchase_common.js.
So you have to either modified in material request js or override it by extending class.