2
0
mirror of https://github.com/frappe/books.git synced 2025-01-08 01:14:39 +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", "fieldname": "outstandingAmount",
"label": "Outstanding Amount", "label": "Outstanding Amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"readOnly": true "readOnly": true,
"filter": true
}, },
{ {
"fieldname": "setDiscountAmount", "fieldname": "setDiscountAmount",

View File

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

View File

@ -33,6 +33,7 @@ export interface BaseField {
groupBy?: string; // UI Facing used in dropdowns fields groupBy?: string; // UI Facing used in dropdowns fields
meta?: boolean; // Field is a meta field, i.e. only for the db, not UI 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. 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. 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( return fyo.schemaMap[this.schemaName].fields.filter(
(f) => (f) =>
!f.computed && f.filter ||
(!f.computed &&
!excludedFieldsTypes.includes(f.fieldtype) && !excludedFieldsTypes.includes(f.fieldtype) &&
!f.meta && !f.meta &&
!f.readOnly !f.readOnly)
); );
}, },
fieldOptions() { fieldOptions() {