From 2780bc7b40dfcd7f31f0e5c8227601df585cfae2 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 28 Jan 2024 20:02:46 +0530 Subject: [PATCH] fix: allow currency fieldtype in filter --- crm/api/doc.py | 1 + frontend/src/components/Filter.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index 14e94a9a..9273fef7 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -40,6 +40,7 @@ def get_filterable_fields(doctype: str): "Data", "Float", "Int", + "Currency", "Link", "Long Text", "Select", diff --git a/frontend/src/components/Filter.vue b/frontend/src/components/Filter.vue index 41c10059..fb03e688 100644 --- a/frontend/src/components/Filter.vue +++ b/frontend/src/components/Filter.vue @@ -104,7 +104,7 @@ import { h, defineModel, computed } from 'vue' const typeCheck = ['Check'] const typeLink = ['Link'] -const typeNumber = ['Float', 'Int'] +const typeNumber = ['Float', 'Int', 'Currency', 'Percent'] const typeSelect = ['Select'] const typeString = ['Data', 'Long Text', 'Small Text', 'Text Editor', 'Text'] const typeDate = ['Date', 'Datetime'] @@ -209,6 +209,7 @@ function getOperators(fieldtype, fieldname) { options = [ { label: 'Like', value: 'like' }, { label: 'Not Like', value: 'not like' }, + { label: 'Is', value: 'is' }, ] } if (typeNumber.includes(fieldtype)) { @@ -340,6 +341,7 @@ function getSelectOptions(options) { } function setfilter(data) { + if (!data) return filters.value.add({ field: { label: data.label,