Try ERPNext Buy Support Partners Foundation

Set_query with OR multi conditional parameter filters

Dear all,
I have a link field that I want to filter based on conditional in the source docname.
The source is checkbox. So I want to display in the link field only those that are checked (“food is checked” OR “drink is checked”)
I know I can filter with this for only 1 filter:

frappe.ui.form.on('Store', {
setup: function(frm) {
	cur_frm.set_query("item_sold", function() {
		return {
			"filters": [
				"Selling Items","food", "=", "1"
			]
		}
	});
  }
});

But now I want it to return those stores that sell food OR drink.
I tried:

"Selling Items", ["in", [["food","=","1"],["drink","=","1"]]]

but it doesn’t return anything.
If I use

["Selling Items","food", "=", "1"],
["Selling Items","drink", "=", "1"]

it returns food AND drink.

And if I use : (colon) to separate the doctype with filter parameter, it doesn’t work.

How can I use the multi ‘OR’ filter with conditions?
I use erpnext and frappe latest version.
Thank you for any help.

Try

filters: [["Selling Items","food" || "drink","=",1]]

1 Like

Doesn’t work.
Even in the dropdown field in the form still written “Filters applied for Food = 1” (depends on which filter is put first)