Hii everyone,
While fetching data from database sometimes you want to check some conditions like if item in list or not in list.
Here i am filtering those items having warehouse in my list_warehouse
. Hope this topic will help you.
items = frappe.db.sql(“select item_name from tabItem where item_group = %s and default_warehouse in (%s) " % (‘%s’,”, “.join([”%s"]*len(list_warehouse))),tuple([group] + list_warehouse),as_dict=1)