frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
20.37k stars 7.08k forks source link

[Enhancement] List and Report Filter conditionality #15557

Open Tropicalrambler opened 5 years ago

Tropicalrambler commented 5 years ago

Current behavior List and report views allow the user to set filters by field, with comparison operators to allow selecting subsets of records. However, when user wishes to filter by two different fields, there is no manner by which a conditional operator for these filters can be specified. For example, if I wanted to filter customers by two fields Full Name and Customer Group, I could only find records which satisfy both filter conditions, amounting to an AND conditional operator.

Searching for Customer with Full name like "peter" AND Customer group like "small business" will yield only those records which satisfy both conditions simultaneously, such as: Peter with Small Business. If Peter was in a Customer group named "Medium Business", this record would be filtered out or not shown.

Proposed behavior Add a method of choosing the conditionality of the filters, so that users can specify how the filters interact with each other. Following the above example, if I wanted to find all Customers whose name are Peter OR whose Customer Group is "Small Business" then I would be shown the record for Peter because it satisfied the OR condition. I also would be shown all those Customers with Customer Group as "Small Business".

Options would be: AND OR

djpalshikar commented 5 years ago

With AND and OR both present it would help if we have nested filters.

clarkejj commented 4 years ago

Here's a similar request https://github.com/frappe/erpnext/issues/15444