2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 02:49:03 +00:00

fix: show name if numberSeries naming

This commit is contained in:
18alantom 2023-10-09 14:03:37 +05:30
parent e0b010554c
commit 0a41f39e4a

View File

@ -587,12 +587,7 @@ function getTemplateFields(
}
for (const field of schema.fields) {
if (
field.computed ||
field.meta ||
field.hidden ||
(field.readOnly && !field.required)
) {
if (shouldSkipField(field, schema)) {
continue;
}
@ -650,3 +645,23 @@ export function getColumnLabel(field: TemplateField): string {
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;
}