diff --git a/fyo/models/NumberSeries.ts b/fyo/models/NumberSeries.ts index b3fa8244..661b516b 100644 --- a/fyo/models/NumberSeries.ts +++ b/fyo/models/NumberSeries.ts @@ -1,4 +1,5 @@ import { Doc } from 'fyo/model/doc'; +import { ReadOnlyMap } from 'fyo/model/types'; function getPaddedName(prefix: string, next: number, padZeros: number): string { return prefix + next.toString().padStart(padZeros ?? 4, '0'); @@ -46,4 +47,10 @@ export default class NumberSeries extends Doc { getPaddedName(next: number): string { return getPaddedName(this.name as string, next, this.padZeros as number); } + + readOnly: ReadOnlyMap = { + referenceType: () => this.inserted, + padZeros: () => this.inserted, + start: () => this.inserted, + }; } diff --git a/schemas/app/NumberSeries.json b/schemas/app/NumberSeries.json index 4da950b5..497b2cc2 100644 --- a/schemas/app/NumberSeries.json +++ b/schemas/app/NumberSeries.json @@ -61,8 +61,7 @@ } ], "default": "-", - "required": true, - "readOnly": true + "required": true }, { "fieldname": "current", diff --git a/src/utils/search.ts b/src/utils/search.ts index 407bd0aa..008f147d 100644 --- a/src/utils/search.ts +++ b/src/utils/search.ts @@ -214,6 +214,7 @@ function getListViewList(fyo: Fyo): SearchItem[] { ModelNameEnum.Address, ModelNameEnum.AccountingLedgerEntry, ModelNameEnum.Currency, + ModelNameEnum.NumberSeries, ]; const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;