2
0
mirror of https://github.com/frappe/books.git synced 2025-01-04 23:55:24 +00:00

incr: add filter prop on Field

This commit is contained in:
18alantom 2022-07-30 16:06:14 +05:30
parent f59120e2a6
commit 48be520b20
4 changed files with 10 additions and 6 deletions

View File

@ -91,7 +91,8 @@
"fieldname": "outstandingAmount",
"label": "Outstanding Amount",
"fieldtype": "Currency",
"readOnly": true
"readOnly": true,
"filter": true
},
{
"fieldname": "setDiscountAmount",

View File

@ -90,7 +90,8 @@
"fieldname": "outstandingAmount",
"label": "Outstanding Amount",
"fieldtype": "Currency",
"readOnly": true
"readOnly": true,
"filter": true
},
{
"fieldname": "setDiscountAmount",

View File

@ -33,6 +33,7 @@ export interface BaseField {
groupBy?: string; // UI Facing used in dropdowns fields
meta?: boolean; // Field is a meta field, i.e. only for the db, not UI
inline?: boolean; // UI Facing config, whether to display doc inline.
filter?: boolean; // UI Facing config, whether to be used to filter the List.
computed?: boolean; // Computed values are not stored in the database.
}

View File

@ -214,10 +214,11 @@ export default {
];
return fyo.schemaMap[this.schemaName].fields.filter(
(f) =>
!f.computed &&
!excludedFieldsTypes.includes(f.fieldtype) &&
!f.meta &&
!f.readOnly
f.filter ||
(!f.computed &&
!excludedFieldsTypes.includes(f.fieldtype) &&
!f.meta &&
!f.readOnly)
);
},
fieldOptions() {