How can I apply OR conditions in List View or Report filters in Frappe/ERPNext?

I’m trying to filter records in a List View (and similarly in Reports), but I can’t find a way to apply OR conditions between filters.

For example, I want to retrieve records where:

  • Assigned To contains sachin@example
    OR

  • Assigned To is Not Set

However, when I add both filters, Frappe combines them using AND, resulting in:

Assigned To LIKE ‘%sachin@example%’
AND
Assigned To IS Not Set

Since both conditions cannot be true at the same time, the query returns no records.

My questions:

  1. Is there any built-in way to apply OR conditions in List View filters?

  2. Is it possible in Query Reports or Report Builder without writing custom code?

  3. Has anyone implemented this using custom scripts or another approach?

  4. Is there a recommended workaround for this limitation?

I’m using Frappe v16 / ERPNext v16.

Any suggestions or workarounds would be appreciated.

1 Like

Hi @spathakvincular.in

Its a very interesting question. You would think something so simple would exist in a framework which prides itself on its no-code functionality for end users. I guess here is where the low-code part kicks in.

If its the same field like “Assigned To” then use IN operator
Assigned To IN (‘%sachin@example%’, Not Set (or maybe NULL)
I tried the IN operator for other fields like status and it works but for Assigned To it does not work
But if its a different field I could not find a non-code way of doing it

I encourage you to raise a github feature at Issues · frappe/frappe · GitHub

Maybe they have already brain-stormed it and decided against it (cost-benefit analysis)

Thank you @asieftejani

Hi:

Feature request here …

Actually, backend manage or_filters but no UI option for now.

But … maybe there is something in the oven

1 Like