fix: allow setting non filterable fields
This commit is contained in:
parent
4aa0c1402f
commit
e850928e57
@ -30,6 +30,11 @@ def get_filterable_fields(doctype: str):
|
|||||||
"Text",
|
"Text",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
c = get_controller(doctype)
|
||||||
|
restricted_fields = []
|
||||||
|
if hasattr(c, "get_non_filterable_fields"):
|
||||||
|
restricted_fields = c.get_non_filterable_fields()
|
||||||
|
|
||||||
from_doc_fields = (
|
from_doc_fields = (
|
||||||
frappe.qb.from_(DocField)
|
frappe.qb.from_(DocField)
|
||||||
.select(
|
.select(
|
||||||
@ -42,6 +47,7 @@ def get_filterable_fields(doctype: str):
|
|||||||
.where(DocField.parent == doctype)
|
.where(DocField.parent == doctype)
|
||||||
.where(DocField.hidden == False)
|
.where(DocField.hidden == False)
|
||||||
.where(Criterion.any([DocField.fieldtype == i for i in allowed_fieldtypes]))
|
.where(Criterion.any([DocField.fieldtype == i for i in allowed_fieldtypes]))
|
||||||
|
.where(Criterion.all([DocField.fieldname != i for i in restricted_fields]))
|
||||||
.run(as_dict=True)
|
.run(as_dict=True)
|
||||||
)
|
)
|
||||||
res = []
|
res = []
|
||||||
|
|||||||
@ -196,6 +196,10 @@ class CRMLead(Document):
|
|||||||
{ "label": 'Mobile no', "value": 'mobile_no' },
|
{ "label": 'Mobile no', "value": 'mobile_no' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_non_filterable_fields():
|
||||||
|
return ["converted"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_list_data():
|
def default_list_data():
|
||||||
columns = [
|
columns = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user