fix: allow currency fieldtype in filter

This commit is contained in:
Shariq Ansari 2024-01-28 20:02:46 +05:30
parent 322f9d7dda
commit 2780bc7b40
2 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,7 @@ def get_filterable_fields(doctype: str):
"Data", "Data",
"Float", "Float",
"Int", "Int",
"Currency",
"Link", "Link",
"Long Text", "Long Text",
"Select", "Select",

View File

@ -104,7 +104,7 @@ import { h, defineModel, computed } from 'vue'
const typeCheck = ['Check'] const typeCheck = ['Check']
const typeLink = ['Link'] const typeLink = ['Link']
const typeNumber = ['Float', 'Int'] const typeNumber = ['Float', 'Int', 'Currency', 'Percent']
const typeSelect = ['Select'] const typeSelect = ['Select']
const typeString = ['Data', 'Long Text', 'Small Text', 'Text Editor', 'Text'] const typeString = ['Data', 'Long Text', 'Small Text', 'Text Editor', 'Text']
const typeDate = ['Date', 'Datetime'] const typeDate = ['Date', 'Datetime']
@ -209,6 +209,7 @@ function getOperators(fieldtype, fieldname) {
options = [ options = [
{ label: 'Like', value: 'like' }, { label: 'Like', value: 'like' },
{ label: 'Not Like', value: 'not like' }, { label: 'Not Like', value: 'not like' },
{ label: 'Is', value: 'is' },
] ]
} }
if (typeNumber.includes(fieldtype)) { if (typeNumber.includes(fieldtype)) {
@ -340,6 +341,7 @@ function getSelectOptions(options) {
} }
function setfilter(data) { function setfilter(data) {
if (!data) return
filters.value.add({ filters.value.add({
field: { field: {
label: data.label, label: data.label,