Making categories in sales invoice

In sales invoice we have a list of items. But if we want specific list of items to be displayed related a particular categories/group , how can we achieve that by using drop-down? suppose if we have list of items like electronic gadgets , sports materials, bike parts etc. If we click electronic gadgets it should show only electronic device in sales invoice and not about bikes and sport materials.

Hi @surajjahagirdar I guess that you can do something like this:

item_code:function(doc, cdt, cdn) {
var item = frappe.get_doc(cdt, cdn);
frappe.db.get_value(“Item”, { item_group: “your item group”},
[“item_name”],
function®{
your return
});
}

Or you can use get_query:

cur_frm.fields_dict[‘item’].get_query = function(doc, cdt, cdn) {
return{
filters: [
[‘Item’, ‘group_item’, ‘=’, ‘your_group’]
]
}
}

Thank Thiago , i just want to know in which file we have to modify it ? for that any handler is required ?

You already have your app?

No , i have erp and frappe files from github

Well I guess that in this case you should read all the manual or do a consulting.

Ok Thaigo