fix: Consider Table Multiselect fields in Query engine
- Since table multiselect fields were not handled, the query tried searching for this child field in item master - This broke the query - On trying to reload or go back to all-products page with field filters that are table mutiselect, page breaks
This commit is contained in:
parent
9f305e983c
commit
f913838373
@ -115,6 +115,17 @@ class ProductQuery:
|
|||||||
if not values:
|
if not values:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# handle multiselect fields in filter addition
|
||||||
|
meta = frappe.get_meta('Item', cached=True)
|
||||||
|
df = meta.get_field(field)
|
||||||
|
if df.fieldtype == 'Table MultiSelect':
|
||||||
|
child_doctype = df.options
|
||||||
|
child_meta = frappe.get_meta(child_doctype, cached=True)
|
||||||
|
fields = child_meta.get("fields", { "fieldtype": "Link", "in_list_view": 1 })
|
||||||
|
if fields:
|
||||||
|
self.filters.append([child_doctype, fields[0].fieldname, 'IN', values])
|
||||||
|
continue
|
||||||
|
|
||||||
if isinstance(values, list):
|
if isinstance(values, list):
|
||||||
# If value is a list use `IN` query
|
# If value is a list use `IN` query
|
||||||
self.filters.append([field, 'IN', values])
|
self.filters.append([field, 'IN', values])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user