mirror of
https://github.com/frappe/books.git
synced 2024-12-22 19:09:01 +00:00
incr: use common form for now
- fix custom field type
This commit is contained in:
parent
bf10927be9
commit
93ad5d6a9a
@ -4,12 +4,15 @@ import { getListFromMap, getMapFromList } from 'utils';
|
||||
import regionalSchemas from './regional';
|
||||
import { appSchemas, coreSchemas, metaSchemas } from './schemas';
|
||||
import type {
|
||||
DynamicLinkField,
|
||||
Field,
|
||||
OptionField,
|
||||
Schema,
|
||||
SchemaMap,
|
||||
SchemaStub,
|
||||
SchemaStubMap,
|
||||
SelectOption,
|
||||
TargetField,
|
||||
} from './types';
|
||||
|
||||
const NAME_FIELD = {
|
||||
@ -319,16 +322,28 @@ function getFieldMapFromRawCustomFields(
|
||||
label,
|
||||
fieldname,
|
||||
fieldtype,
|
||||
required: isRequired,
|
||||
section,
|
||||
tab,
|
||||
target,
|
||||
options,
|
||||
references,
|
||||
isCustom: true,
|
||||
};
|
||||
} as Field;
|
||||
|
||||
map[parent].push(field as Field);
|
||||
if (options?.length) {
|
||||
(field as OptionField).options = options;
|
||||
}
|
||||
|
||||
if (typeof isRequired === 'number' || typeof isRequired === 'boolean') {
|
||||
field.required = Boolean(isRequired);
|
||||
}
|
||||
|
||||
if (typeof target === 'string') {
|
||||
(field as TargetField).target === 'target';
|
||||
}
|
||||
|
||||
if (typeof references === 'string') {
|
||||
(field as DynamicLinkField).references === 'references';
|
||||
}
|
||||
|
||||
map[parent].push(field);
|
||||
return map;
|
||||
},
|
||||
{} as Record<string, Field[]>
|
||||
|
@ -287,7 +287,8 @@ function getCompleteSidebar(): SidebarConfig {
|
||||
{
|
||||
label: t`Customize Form`,
|
||||
name: 'customize-form',
|
||||
route: `/customize-form`,
|
||||
// route: `/customize-form`,
|
||||
route: `/list/CustomForm/${t`Customize Form`}`,
|
||||
hidden: () =>
|
||||
!fyo.singles.AccountingSettings?.enableFormCustomization,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user