mirror of
https://github.com/frappe/books.git
synced 2024-12-22 10:58:59 +00:00
fix(ux): allow NumberSeries search and create
This commit is contained in:
parent
b618340cec
commit
6f11d6e6c2
@ -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,
|
||||
};
|
||||
}
|
||||
|
@ -61,8 +61,7 @@
|
||||
}
|
||||
],
|
||||
"default": "-",
|
||||
"required": true,
|
||||
"readOnly": true
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"fieldname": "current",
|
||||
|
@ -214,6 +214,7 @@ function getListViewList(fyo: Fyo): SearchItem[] {
|
||||
ModelNameEnum.Address,
|
||||
ModelNameEnum.AccountingLedgerEntry,
|
||||
ModelNameEnum.Currency,
|
||||
ModelNameEnum.NumberSeries,
|
||||
];
|
||||
|
||||
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
||||
|
Loading…
Reference in New Issue
Block a user