mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +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 { Doc } from 'fyo/model/doc';
|
||||||
|
import { ReadOnlyMap } from 'fyo/model/types';
|
||||||
|
|
||||||
function getPaddedName(prefix: string, next: number, padZeros: number): string {
|
function getPaddedName(prefix: string, next: number, padZeros: number): string {
|
||||||
return prefix + next.toString().padStart(padZeros ?? 4, '0');
|
return prefix + next.toString().padStart(padZeros ?? 4, '0');
|
||||||
@ -46,4 +47,10 @@ export default class NumberSeries extends Doc {
|
|||||||
getPaddedName(next: number): string {
|
getPaddedName(next: number): string {
|
||||||
return getPaddedName(this.name as string, next, this.padZeros as number);
|
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": "-",
|
"default": "-",
|
||||||
"required": true,
|
"required": true
|
||||||
"readOnly": true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "current",
|
"fieldname": "current",
|
||||||
|
@ -214,6 +214,7 @@ function getListViewList(fyo: Fyo): SearchItem[] {
|
|||||||
ModelNameEnum.Address,
|
ModelNameEnum.Address,
|
||||||
ModelNameEnum.AccountingLedgerEntry,
|
ModelNameEnum.AccountingLedgerEntry,
|
||||||
ModelNameEnum.Currency,
|
ModelNameEnum.Currency,
|
||||||
|
ModelNameEnum.NumberSeries,
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
||||||
|
Loading…
Reference in New Issue
Block a user