Added all field types to universal field modal
This commit is contained in:
parent
2042e2365a
commit
1680da6f31
|
|
@ -3100,22 +3100,28 @@ function openUniversalFieldModal(frm, fieldId = null) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Фильтруем только числовые поля
|
||||
const numericFields = meta.fields.filter(field =>
|
||||
['Int', 'Float', 'Currency'].includes(field.fieldtype)
|
||||
// Получаем все доступные поля, а не только числовые
|
||||
const excluded_types = [
|
||||
"Tab Break", "Column Break", "Button", "Section Break", "Column Break",
|
||||
"HTML", "Table", "Attach", "Attach Image", "Code", "Text Editor", "Image",
|
||||
"Heading", "Fold", "Table MultiSelect"
|
||||
];
|
||||
|
||||
const availableFields = meta.fields.filter(field =>
|
||||
!excluded_types.includes(field.fieldtype)
|
||||
);
|
||||
|
||||
if (numericFields.length === 0) {
|
||||
if (availableFields.length === 0) {
|
||||
frappe.msgprint({
|
||||
title: __('Предупреждение'),
|
||||
message: __(`В DocType ${selectedDoctype} не найдено числовых полей`),
|
||||
message: __(`В DocType ${selectedDoctype} не найдено подходящих полей`),
|
||||
indicator: 'orange'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Обновляем опции для поля fieldname
|
||||
const options = numericFields.map(field => ({
|
||||
const options = availableFields.map(field => ({
|
||||
label: field.label || field.fieldname,
|
||||
value: field.fieldname
|
||||
}));
|
||||
|
|
@ -3130,8 +3136,7 @@ function openUniversalFieldModal(frm, fieldId = null) {
|
|||
// Обновляем опции для поля фильтра
|
||||
const filterFieldOptions = meta.fields
|
||||
.filter(field =>
|
||||
['Int', 'Float', 'Currency', 'Data', 'Text', 'Date', 'Datetime',
|
||||
'Check', 'Select', 'Link', 'Small Text', 'Read Only'].includes(field.fieldtype)
|
||||
!excluded_types.includes(field.fieldtype)
|
||||
)
|
||||
.map(field => ({
|
||||
label: field.label || field.fieldname,
|
||||
|
|
|
|||
Loading…
Reference in New Issue