2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +00:00

fix: show name if numberSeries naming

This commit is contained in:
18alantom 2023-10-09 14:03:37 +05:30 committed by Alan
parent e0b010554c
commit 00ec72263f

View File

@ -587,12 +587,7 @@ function getTemplateFields(
} }
for (const field of schema.fields) { for (const field of schema.fields) {
if ( if (shouldSkipField(field, schema)) {
field.computed ||
field.meta ||
field.hidden ||
(field.readOnly && !field.required)
) {
continue; continue;
} }
@ -650,3 +645,23 @@ export function getColumnLabel(field: TemplateField): string {
return field.label; return field.label;
} }
function shouldSkipField(field: Field, schema: Schema): boolean {
if (field.computed || field.meta) {
return true;
}
if (schema.naming === 'numberSeries' && field.fieldname === 'name') {
return false;
}
if (field.hidden) {
return true;
}
if (field.readOnly && !field.required) {
return true;
}
return false;
}