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:
parent
e0b010554c
commit
00ec72263f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user